import { useMemo } from 'react'; import { MaterialReactTable, MRT_ColumnDef } from 'material-react-table'; import mockData from '../data/mockData'; function formatCurrency(amount: number) { return amount?.toLocaleString('ru-RU', { style: 'currency', currency: 'RUB', minimumFractionDigits: 0, }) ?? ''; } const statusColor: Record = { 'Завершена': '#4caf50', 'Ожидается': '#ff9800', 'Ошибка': '#f44336', }; export default function BillingPayoutsTable() { const columns = useMemo[]>( () => [ { accessorKey: 'id', header: 'ID' }, { accessorKey: 'amount', header: 'Сумма', Cell: ({ cell }) => formatCurrency(cell.getValue() as number) }, { accessorKey: 'date', header: 'Дата' }, { accessorKey: 'status', header: 'Статус', Cell: ({ cell }) => ( {cell.getValue() as string} ) }, { accessorKey: 'method', header: 'Способ' }, ], [] ); return ( ); }