33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { useMemo } from "react";
|
|
import { MRT_ColumnDef } from "mantine-react-table";
|
|
import { ActiveWorkShiftSchema } from "../../../../client";
|
|
|
|
export const useActiveShiftsTableColumns = () => {
|
|
return useMemo<MRT_ColumnDef<ActiveWorkShiftSchema>[]>(
|
|
() => [
|
|
{
|
|
header: "Начало смены",
|
|
accessorKey: "startedAt",
|
|
Cell: ({ row }) =>
|
|
new Date(row.original.startedAt).toLocaleString("ru-RU"),
|
|
},
|
|
{
|
|
header: "ФИО",
|
|
Cell: ({ row }) =>
|
|
`${row.original.user.firstName} ${row.original.user.secondName}`,
|
|
},
|
|
{
|
|
header: "Роль",
|
|
accessorKey: "user.role.name",
|
|
enableSorting: false,
|
|
},
|
|
{
|
|
header: "Должность",
|
|
accessorKey: "user.position.name",
|
|
enableSorting: false,
|
|
}
|
|
],
|
|
[]
|
|
);
|
|
};
|