import {
  DateInput,
  Edit,
  NumberInput,
  SelectInput,
  SimpleForm,
} from "react-admin";
import {
  equipmentStatusChoices,
  equipmentTypeChoices,
  laborOperationChoices,
  periodicityChoices,
} from "../shared/enums";
import { PlainInput } from "../shared/inputs";

export const EquipmentEdit = () => (
  <Edit>
    <SimpleForm>
      <PlainInput source="name" />
      <PlainInput source="serialNumber" />
      <PlainInput source="inventoryNumber" />
      <SelectInput source="equipmentType" choices={equipmentTypeChoices} />
      <DateInput source="dateOfInspection" />
      <SelectInput source="periodicityTO" choices={periodicityChoices} />
      <PlainInput source="location" />
      <SelectInput source="status" choices={equipmentStatusChoices} />
      <DateInput source="commissionedAt" />
      <NumberInput source="totalEngineHours" />
      <NumberInput source="engineHoursSinceLastRepair" />
      <DateInput source="lastRepairAt" />
      <PlainInput source="notes" multiline />
      <SelectInput source="workAsPartOf" choices={laborOperationChoices} />
      <NumberInput source="fuelConsumed" />
    </SimpleForm>
  </Edit>
);
