feat: work shifts by QR codes

This commit is contained in:
2024-11-20 13:09:55 +04:00
parent bf774f5c04
commit 39f746f435
15 changed files with 501 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
import { useMemo } from "react";
import { MRT_ColumnDef } from "mantine-react-table";
import { ActiveWorkShiftSchema } from "../../../../client";
export const useActiveShiftsTableColumns = () => {
return useMemo<MRT_ColumnDef<ActiveWorkShiftSchema>[]>(
() => [
{
header: "Начало смены",
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",
},
{
header: "Должность",
accessorKey: "user.position.name",
}
],
[]
);
};