import TextField from "@mui/material/TextField";

export interface InputProps {
  disabled?: boolean;
  error?: boolean;
  helperText?: string;
  isConfirm?: boolean;
  label?: string;
  name: string;
  onBlur?: (...a: any[]) => any;
  onChange?: (...a: any[]) => any;
  placeholder?: string;
  required?: boolean;
  value?: string;
  id?: string;
}

export function TextInputElement(props: React.PropsWithChildren<InputProps>) {
  return (
    <TextField
      className="w-full text-xs"
      disabled={props.disabled}
      error={props.error}
      fullWidth
      helperText={props.helperText}
      id={props.id}
      label={props.label}
      name={props.name}
      onBlur={props.onBlur}
      onChange={props.onChange}
      placeholder={props.placeholder}
      required={props.required}
      type="text"
      value={props.value}
      variant="outlined"
    />
  );
}
