chore: heygermany customer project
This commit is contained in:
25
apps/website/components/common/EnumSelect.tsx
Normal file
25
apps/website/components/common/EnumSelect.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useI18n } from '@/context/i18n-provider';
|
||||
import { Select, SelectProps } from '@pikku/mantine/core';
|
||||
|
||||
interface EnumSelectProps extends Omit<SelectProps, 'data'> {
|
||||
enumObject: Record<string, string>;
|
||||
enumName: string;
|
||||
label?: any;
|
||||
placeholder?: any;
|
||||
}
|
||||
|
||||
export const EnumSelect: React.FC<EnumSelectProps> = ({
|
||||
enumObject,
|
||||
enumName,
|
||||
...selectProps
|
||||
}) => {
|
||||
const t = useI18n()
|
||||
const options = t.getEnumOptions(enumObject, enumName);
|
||||
|
||||
return (
|
||||
<Select
|
||||
{...(selectProps as any)}
|
||||
data={options}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user