feat: residues accounting
This commit is contained in:
		
							
								
								
									
										32
									
								
								src/pages/ResiduesPage/hooks/residuesTableColumns.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/pages/ResiduesPage/hooks/residuesTableColumns.tsx
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
import { useMemo } from "react";
 | 
			
		||||
import { MRT_ColumnDef, MRT_RowData } from "mantine-react-table";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const useResiduesTableColumns = <T extends MRT_RowData>() => {
 | 
			
		||||
    return useMemo<MRT_ColumnDef<T>[]>(
 | 
			
		||||
        () => [
 | 
			
		||||
            {
 | 
			
		||||
                header: "Название",
 | 
			
		||||
                accessorKey: "product.name",
 | 
			
		||||
                Cell: ({ row }) => row.original.product?.name ?? "-",
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                header: "Артикул",
 | 
			
		||||
                accessorKey: "product.article",
 | 
			
		||||
                Cell: ({ row }) => row.original.product?.article ?? "-",
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                header: "Размер",
 | 
			
		||||
                accessorKey: "product.size",
 | 
			
		||||
                Cell: ({ row }) => row.original.product?.size ?? "-",
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                header: "Количество",
 | 
			
		||||
                accessorKey: "quantity",
 | 
			
		||||
            },
 | 
			
		||||
        ],
 | 
			
		||||
        [],
 | 
			
		||||
    );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default useResiduesTableColumns;
 | 
			
		||||
		Reference in New Issue
	
	Block a user