feat: add generated code: frontend/src/resources/equipment/EquipmentList.tsx
This commit is contained in:
28
frontend/src/resources/equipment/EquipmentList.tsx
Normal file
28
frontend/src/resources/equipment/EquipmentList.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
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>
|
||||
);
|
||||
Reference in New Issue
Block a user