feat: move dropdown mui to ui directory

This commit is contained in:
amhsirak
2025-01-09 19:48:39 +05:30
parent 6c59dc5833
commit 31a5e44de1
8 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
import React from 'react';
import { FormControl, InputLabel, Select } from "@mui/material";
import { SelectChangeEvent } from "@mui/material/Select/Select";
import { SxProps } from '@mui/system';
interface DropdownProps {
id: string;
label: string;
value: string | undefined;
handleSelect: (event: SelectChangeEvent) => void;
children?: React.ReactNode;
sx?: SxProps;
};
export const Dropdown = ({ id, label, value, handleSelect, children, sx }: DropdownProps) => {
return (
<FormControl sx={sx} size="small">
<InputLabel id={id}>{label}</InputLabel>
<Select
labelId={id}
name={id}
value={value}
label={label}
onChange={handleSelect}
size='small'
sx={sx}
>
{children}
</Select>
</FormControl>
);
};