import { View, type ViewProps } from 'react-native';

import { useThemeColor } from '@/hooks/use-theme-color';

export type ThemedViewProps = ViewProps & {
  lightColor?: string;
  darkColor?: string;
  lvl?:number;
};

export function ThemedView({ style, lightColor, darkColor,lvl=1, ...otherProps }: ThemedViewProps) {
  var lvlStr:string = "background";
  if(lvl>=0 && lvl<6){
    lvlStr+=lvl;
  }
  else lvlStr+='5';


  const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor },lvlStr as 'background0'|'background1'|'background2'|'background3'|'background4'|'background5');


  return <View style={[{ backgroundColor }, style]} {...otherProps} />;
}
