feat: 去掉antd
This commit is contained in:
18
packages/components/src/select/index.tsx
Normal file
18
packages/components/src/select/index.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { MenuItem, Select as MuiSelect, SelectProps as MuiSelectProps } from '@mui/material';
|
||||
|
||||
type SelectProps = {
|
||||
options?: { label: string; value: string }[];
|
||||
} & MuiSelectProps;
|
||||
|
||||
export const Select = (props: SelectProps) => {
|
||||
const { options, ...rest } = props;
|
||||
return (
|
||||
<MuiSelect {...rest}>
|
||||
{options?.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</MenuItem>
|
||||
))}
|
||||
</MuiSelect>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user