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