cal.pub0.org/packages/ui/v2/core/TimezoneSelect.tsx

30 lines
688 B
TypeScript

import { useMemo } from "react";
import BaseSelect, {
allTimezones,
ITimezoneOption,
ITimezone,
Props as SelectProps,
} from "react-timezone-select";
import { getReactSelectProps } from "../..";
function TimezoneSelect({ className, components, ...props }: SelectProps) {
const reactSelectProps = useMemo(() => {
return getReactSelectProps({ className, components: components || {} });
}, [className, components]);
return (
<BaseSelect
{...reactSelectProps}
timezones={{
...allTimezones,
"America/Asuncion": "Asuncion",
}}
{...props}
/>
);
}
export default TimezoneSelect;
export type { ITimezone, ITimezoneOption };