Files
test-gen-10/frontend/src/resources/equipment/EquipmentList.tsx

28 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { List, DataTable, TextField, DateField, EditButton, ShowButton } from 'react-admin';
import { SelectField } from 'react-admin';
const equipmentStatusChoices = [
{ id: 'Active', name: 'В эксплуатации' },
{ id: 'Repair', name: 'В ремонте' },
{ id: 'Reserve', name: 'В резерве' },
{ id: 'WriteOff', name: 'Списано' },
];
export const EquipmentList = () => (
<List>
<DataTable>
<DataTable.Col source="id" />
<DataTable.Col source="name" />
<DataTable.Col source="serialNumber" />
<DataTable.Col source="dateOfInspection" field={DateField} />
<DataTable.Col source="commissionedAt" field={DateField} />
<DataTable.Col source="status" field={(props) => <SelectField {...props} choices={equipmentStatusChoices} />} />
<DataTable.Col source="createdAt" field={DateField} />
<DataTable.Col source="updatedAt" field={DateField} />
<DataTable.Col>
<EditButton />
<ShowButton />
</DataTable.Col>
</DataTable>
</List>
);