frontPanel/src/ui_kit/CustomTextField.tsx

43 lines
1.1 KiB
TypeScript
Executable File

import {FormControl, TextField, useTheme, SxProps, Theme} from "@mui/material";
interface CustomTextFieldProps {
placeholder: string;
text?: string;
sx?: SxProps<Theme>;
}
export default function CustomTextField({ placeholder, text, sx}: CustomTextFieldProps) {
const theme = useTheme();
return (
<FormControl
fullWidth
variant="standard"
sx={{ p: 0 }}
>
<TextField
value={text}
fullWidth
placeholder={placeholder}
sx={{
"& .MuiInputBase-root": {
backgroundColor: theme.palette.background.default,
height: "48px",
borderRadius: "10px",
},
...sx
}}
inputProps={{
sx: {
borderRadius: "10px",
fontSize: "18px",
lineHeight: "21px",
py: 0,
}
}}
/>
</FormControl>
);
}