import { useColorScheme as RNUseColorScheme } from 'react-native';
import { useBaseStore } from '../stores/base';

export function useColorScheme() {
  const userTheme = useBaseStore((s) => s.theme);
  const systemScheme = RNUseColorScheme();

  if (userTheme === 'auto') {
    return systemScheme === 'dark' ? 'dark' : 'light';
  }

  return userTheme;
}