Create/detail updates
This commit is contained in:
parent
b0fb643b6a
commit
0997e449bb
26 changed files with 684 additions and 108 deletions
31
packages/ui/components/Select.tsx
Normal file
31
packages/ui/components/Select.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { FC } from "react";
|
||||
import { Select as InternalSelect } from "@mui/material";
|
||||
|
||||
type SelectProps = {
|
||||
name: string;
|
||||
label: string;
|
||||
formState: Record<string, any>;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
export const Select: FC<SelectProps> = ({
|
||||
name,
|
||||
label,
|
||||
formState,
|
||||
children,
|
||||
}) => (
|
||||
<InternalSelect
|
||||
fullWidth
|
||||
name={name}
|
||||
label={label}
|
||||
variant="outlined"
|
||||
size="small"
|
||||
inputProps={{ id: name }}
|
||||
defaultValue={formState.values[name] || ""}
|
||||
sx={{
|
||||
backgroundColor: "#fff",
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</InternalSelect>
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue