Bridge integration
This commit is contained in:
parent
42a5e09c94
commit
162390008b
56 changed files with 776 additions and 591 deletions
38
packages/ui/components/Autocomplete.tsx
Normal file
38
packages/ui/components/Autocomplete.tsx
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { FC } from "react";
|
||||
import { TextField, Autocomplete as AutocompleteInternal } from "@mui/material";
|
||||
import { colors } from "../styles/theme";
|
||||
|
||||
type AutocompleteProps = {
|
||||
name: string;
|
||||
label: string;
|
||||
options: any[];
|
||||
formState: Record<string, any>;
|
||||
disabled?: boolean;
|
||||
required?: boolean;
|
||||
};
|
||||
|
||||
export const Autocomplete: FC<AutocompleteProps> = ({
|
||||
name,
|
||||
label,
|
||||
options,
|
||||
formState,
|
||||
disabled = false,
|
||||
required = false,
|
||||
}) => (
|
||||
<AutocompleteInternal
|
||||
disablePortal
|
||||
options={options}
|
||||
defaultValue={formState.values[name]}
|
||||
fullWidth
|
||||
size="small"
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
{...params}
|
||||
label={label}
|
||||
disabled={disabled}
|
||||
required={required}
|
||||
sx={{ backgroundColor: colors.white }}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue