import { useId, useMemo } from 'react' import { joinTimeHHMM, splitTimeHHMM } from '../utils/logEntryPayload.js' import { preferNativeCameraPicker } from '../utils/captureVideoFrame.js' const HOURS = Array.from({ length: 24 }, (_, i) => String(i).padStart(2, '0')) const MINUTES = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, '0')) interface EventTimeInput24hProps { value: string onChange: (value: string) => void disabled?: boolean 'aria-label'?: string fallback?: string } export default function EventTimeInput24h({ value, onChange, disabled = false, 'aria-label': ariaLabel, fallback }: EventTimeInput24hProps) { const baseId = useId() const useNativePicker = preferNativeCameraPicker() const { hours, minutes } = useMemo(() => splitTimeHHMM(value, fallback), [value, fallback]) const timeValue = useMemo(() => { if (!value.trim()) return '' return joinTimeHHMM(hours, minutes) }, [value, hours, minutes]) if (useNativePicker) { return (