/* Copyright (C) 2024 Manuel Bustillo*/ 'use client' import { AbstractApi } from '@/app/api/abstract-api'; import { Expense, ExpenseSerializer } from '@/app/lib/expense'; import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline'; import TableOfContents from "../components/table-of-contents"; export default function ExpensesTable({ expenses, onUpdate, onEdit }: { expenses: Expense[], onUpdate: () => void, onEdit: (expense: Expense) => void, }) { const api = new AbstractApi(); const serializer = new ExpenseSerializer(); return ( ( {expense.name} {expense.amount} {expense.pricingType}
{ api.destroy(serializer, expense, onUpdate) }} /> onEdit(expense)} />
)} /> ); }