import { View, Text } from "@tarojs/components";
import './Header.scss'
import { useTranslation } from "react-i18next";
import { getThemeColor } from "@/features/trackTimeDuration/hooks/Common";
import { useSelector } from "react-redux";

export default function Component(props: { title: string, action?: Function }) {
    const time = useSelector((state: any) => state.time);
    const {t} = useTranslation()
    return <View className="header">
        <Text className="header_title">{props.title}</Text>
        <Text className="header_action fast_sleep_text"  onClick={() => { props.action!() }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
        {/* {
            time.scenario=='FAST_SLEEP'?<Text className="header_action fast_sleep_text"  onClick={() => { props.action!() }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>:
            <Text className="header_action" style={{color:getThemeColor(time)}} onClick={() => { props.action!(); }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
        } */}
        
    </View>
}