import Select from 'react-select' import { useSelect } from '@wordpress/data' import { __ } from '@wordpress/i18n' import { store_name } from '../../../store/frontend' import { GiftCardTimezoneSelectProps } from './types' import '../BookingForm/steps/Steps.scss' export const GiftCardTimezoneSelect = ({ value, onChange, }: GiftCardTimezoneSelectProps) => { const timezoneData = useSelect( (select: any) => select(store_name).getTimezoneData(), [] ) const options = (timezoneData?.timezones || []).map((zone: string) => ({ label: zone, value: zone, })) const selected = options.find((option: { value: string }) => option.value === value) || (value ? { label: value, value } : null) return (