feat: work shifts by QR codes
This commit is contained in:
		
							
								
								
									
										29
									
								
								src/pages/AdminPage/components/ActiveShiftsTable/columns.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/pages/AdminPage/components/ActiveShiftsTable/columns.tsx
									
									
									
									
									
										Normal 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",
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        []
 | 
			
		||||
    );
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user