upd
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
interface IOption {
|
||||
id: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface ISelectProps<T extends IOption>
|
||||
extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
||||
multiple?: boolean;
|
||||
options: T[];
|
||||
selected?: T;
|
||||
// onClose: () => void;
|
||||
}
|
||||
|
||||
export default function Select<T extends IOption>({
|
||||
multiple,
|
||||
options,
|
||||
selected,
|
||||
onClose,
|
||||
...props
|
||||
}: ISelectProps<T>) {
|
||||
return (
|
||||
<select {...props}>
|
||||
{options.map(({ id, value }) => (
|
||||
<option key={id}>{value}</option>
|
||||
))}
|
||||
</select>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user