feat: additional expenses

This commit is contained in:
2024-11-26 01:37:15 +04:00
parent e3146832a5
commit 564895c26f
18 changed files with 430 additions and 12 deletions

View File

@@ -0,0 +1,37 @@
import { useMemo } from "react";
import { MRT_ColumnDef } from "mantine-react-table";
import { ExpenseSchemaBase } from "../../../../../client";
import { formatDate } from "../../../../../types/utils.ts";
export const useExpensesTableColumns = () => {
return useMemo<MRT_ColumnDef<ExpenseSchemaBase>[]>(
() => [
{
accessorKey: "spentDate",
header: "Дата",
Cell: ({ row }) => formatDate(row.original.spentDate as string),
},
{
accessorKey: "name",
header: "Наименование",
},
{
accessorKey: "comment",
header: "Комментарий",
},
{
accessorKey: "amount",
header: "Сумма",
},
{
accessorKey: "createdByUser",
header: "Создал запись",
Cell: ({ row }) => {
return `${row.original.createdByUser.firstName} ${row.original.createdByUser.secondName}`;
},
},
],
[],
);
};