import { DateInput, Edit, SelectInput, SimpleForm, TextInput as RaTextInput } from 'react-admin';
import { equipmentStatusChoices } from './shared';

const equipmentLabels = {
  dateOfInspection: 'Дата поверки',
  commissionedAt: 'Дата изготовления',
  name: 'Название',
  serialNumber: 'Серийный номер',
  status: 'Статус',
};

export function EquipmentEdit() {
  return (
    <Edit>
      <SimpleForm>
        <DateInput source="dateOfInspection" label={equipmentLabels.dateOfInspection} />
        <DateInput source="commissionedAt" label={equipmentLabels.commissionedAt} />
        <RaTextInput source="name" label={equipmentLabels.name} />
        <RaTextInput source="serialNumber" label={equipmentLabels.serialNumber} />
        <SelectInput source="status" label={equipmentLabels.status} choices={equipmentStatusChoices} />
      </SimpleForm>
    </Edit>
  );
}
