Files
light-toir-v2/frontend/src/resources/change-equipment-status/ChangeEquipmentStatusList.tsx

26 lines
999 B
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, ReferenceField } from 'react-admin';
import { SelectField } from 'react-admin';
const equipmentStatusChoices = [
{ id: 'Active', name: 'В эксплуатации' },
{ id: 'Repair', name: 'В ремонте' },
{ id: 'Reserve', name: 'В резерве' },
{ id: 'WriteOff', name: 'Списано' },
];
export const ChangeEquipmentStatusList = () => (
<List>
<DataTable>
<DataTable.Col source="equipmentId" field={<ReferenceField source="equipmentId" reference="equipment" />} />
<DataTable.Col source="newStatus" field={<SelectField choices={equipmentStatusChoices} />} />
<DataTable.Col source="number" />
<DataTable.Col source="date" field={DateField} />
<DataTable.Col source="responsible" />
<DataTable.Col source="createdAt" field={DateField} />
<DataTable.Col>
<ShowButton />
<EditButton />
</DataTable.Col>
</DataTable>
</List>
);