import { List, DataTable, TextField, DateField, BooleanField, EditButton, ReferenceField } from 'react-admin';

export const RepairOrderList = () => (
  <List>
    <DataTable>
      <DataTable.Col source="id" />
      <DataTable.Col source="number" />
      <DataTable.Col source="date" field={DateField} />
      <DataTable.Col>
        <ReferenceField source="equipmentId" reference="equipment">
          <TextField source="name" />
        </ReferenceField>
      </DataTable.Col>
      <DataTable.Col source="repairKind" />
      <DataTable.Col source="status" />
      <DataTable.Col source="plannedAt" field={DateField} />
      <DataTable.Col source="startedAt" field={DateField} />
      <DataTable.Col source="completedAt" field={DateField} />
      <DataTable.Col source="contractor" />
      <DataTable.Col source="engineHoursAtRepair" />
      <DataTable.Col source="confirmed" field={BooleanField} />
      <DataTable.Col><EditButton /></DataTable.Col>
    </DataTable>
  </List>
);