import SwitchButtonGroup from '@/components/SwitchButtonGroup'; import { ZONES } from './constants'; import type { ModeType, UnitType, ZoneType } from './constants'; import LiveClock from './LiveClock'; import ResultView from './ResultView'; import { useTimestampConverter } from './useTimestampConverter'; import { useI18n } from '@/utils/chromeI18n'; import { cn } from '@/lib/utils'; import { Input } from '@/components/ui/input'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; const MODE_OPTIONS: { value: ModeType; label: string }[] = [ { value: 'ts2dt', label: 'timestamp:tsToDate' }, { value: 'dt2ts', label: 'timestamp:dateToTs' }, ]; const UNIT_OPTIONS: { value: UnitType; label: string }[] = [ { value: 'ms', label: 'timestamp:unitMs' }, { value: 's', label: 'timestamp:unitS' }, ]; export default function Index() { const { t } = useI18n('timestamp'); const { mode, input, unit, zone, result, error, setMode, setInput, setUnit, setZone, handleUseNow, } = useTimestampConverter(); return (
{error}
}