feat: sx prop for custom dropdown
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
@@ -8,9 +9,10 @@ interface DropdownProps {
|
||||
value: string | undefined;
|
||||
handleSelect: (event: SelectChangeEvent) => void;
|
||||
children?: React.ReactNode;
|
||||
sx?: SxProps;
|
||||
};
|
||||
|
||||
export const Dropdown = ({ id, label, value, handleSelect, children }: DropdownProps) => {
|
||||
export const Dropdown = ({ id, label, value, handleSelect, children, sx }: DropdownProps) => {
|
||||
return (
|
||||
<FormControl sx={{ minWidth: 120 }} size="small">
|
||||
<InputLabel id={id}>{label}</InputLabel>
|
||||
@@ -21,6 +23,7 @@ export const Dropdown = ({ id, label, value, handleSelect, children }: DropdownP
|
||||
label={label}
|
||||
onChange={handleSelect}
|
||||
size='small'
|
||||
sx={sx}
|
||||
>
|
||||
{children}
|
||||
</Select>
|
||||
|
||||
Reference in New Issue
Block a user