import type { Dayjs } from 'dayjs' import { CheckIcon, GlobeIcon } from 'lucide-react' import { useId, useState } from 'react' import { cn, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, Popover, PopoverContent, PopoverTrigger, ScrollArea, } from 'ui' import { getTimezoneLabel, TIMEZONES_BY_IANA, type Timezone } from '@/lib/constants/timezones' interface TimezoneSelectionProps { selectedTimezone: Timezone date: Dayjs onSelectTimezone: (timezone: Timezone) => void } export const TimezoneSelection = ({ selectedTimezone, date, onSelectTimezone, }: TimezoneSelectionProps) => { const [open, setOpen] = useState(false) const listboxId = useId() return (
No timezones found... {TIMEZONES_BY_IANA.map((option) => ( { onSelectTimezone(option) setOpen(false) }} > {getTimezoneLabel(option, date)} ))}
) }