import { FormControl, InputLabel, SxProps, TextField, TextFieldProps, Theme, useMediaQuery, useTheme } from "@mui/material"; interface Props { id?: string; label?: string; labelSx?: SxProps; bold?: boolean; gap?: string; backgroundColor?: string; FormControlSx?: SxProps; TextFieldSx?: SxProps; placeholder?: TextFieldProps["placeholder"]; value?: TextFieldProps["value"]; helperText?: TextFieldProps["helperText"]; error?: TextFieldProps["error"]; type?: TextFieldProps["type"]; onBlur?: TextFieldProps["onBlur"]; onChange?: TextFieldProps["onChange"]; fullWidth?: boolean; } export function PenaTextField({ id = "pena-textfield", label, labelSx, bold = false, gap = "10px", onChange, error, helperText, onBlur, placeholder, type, value, backgroundColor, FormControlSx, TextFieldSx, fullWidth = true, }: Props) { const theme = useTheme(); const upMd = useMediaQuery(theme.breakpoints.up("md")); const labelFont = upMd ? bold ? theme.typography.p1 : { ...theme.typography.body1, fontWeight: 500 } : theme.typography.body2; const placeholderFont = upMd ? undefined : { fontWeight: 400, fontSize: "16px", lineHeight: "19px" }; return ( {label && ( {label} )} ); }