import { TextField } from "@mui/material"; import { memo, useCallback } from "react"; import { makeStylesEdt } from "../../theme"; export type InputProps = { id?: string; value?: string; variables?: Map; bindingDependencies: string[]; disabled?: boolean; label?: string; labelledBy?: string; placeholder?: string; onChange(value: string): void; mandatory?: boolean; maxLength?: number; errors?: { errorMessage: string }; }; export const Input = memo((props: InputProps) => { const { id, value, variables, bindingDependencies, disabled, labelledBy, placeholder, mandatory, errors, maxLength, onChange, } = props; const { classes } = useStyles(); const localValue = value ?? variables?.get(bindingDependencies[0]); return ( ) => onChange(event.target.value), [], )} size="small" variant="outlined" className={classes.input} aria-label="input" /> ); }); const useStyles = makeStylesEdt({ "name": { Input } })(() => ({ input: { width: "100%", }, })); export default Input;