* Removed old root UI components. * Fixed import path * Moved first v2 components to new components dir. * Changed icon to not import from root, since it somehow creates a recursive import * Removed irrelevant todo * Added docs for new components * Fixed type errors * Update packages/ui/components/index.ts Removing as per comment Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
29 lines
668 B
TypeScript
29 lines
668 B
TypeScript
import { useMemo } from "react";
|
|
import BaseSelect, {
|
|
allTimezones,
|
|
ITimezoneOption,
|
|
ITimezone,
|
|
Props as SelectProps,
|
|
} from "react-timezone-select";
|
|
|
|
import { getReactSelectProps } from "../select";
|
|
|
|
export 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 type { ITimezone, ITimezoneOption };
|