- Add Expense CRUD pages (/expenses list, /new form, /[id] detail) + actions - Expense form: date/description/category/amount/receipt, auto-create from purchases - Reports page: 3 tabs (monthly profit, expense breakdown, cash flow) with tables - Add Expenses + Reports to AccountsNav tabs All expense features wired. Reports skeleton ready for data integration. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
26 lines
776 B
TypeScript
26 lines
776 B
TypeScript
import Link from 'next/link';
|
|
|
|
const TABS = [
|
|
{ href: '/admin/accounts', label: 'Ledger' },
|
|
{ href: '/admin/accounts/stock', label: 'Stock' },
|
|
{ href: '/admin/accounts/purchases', label: 'Purchases' },
|
|
{ href: '/admin/accounts/expenses', label: 'Expenses' },
|
|
{ href: '/admin/accounts/reports', label: 'Reports' },
|
|
] as const;
|
|
|
|
export default function AccountsNav({ active }: { active: (typeof TABS)[number]['href'] }) {
|
|
return (
|
|
<div className="mt-4 inline-flex border border-line">
|
|
{TABS.map((tab) => (
|
|
<Link
|
|
key={tab.href}
|
|
href={tab.href}
|
|
className={`px-4 py-1.5 text-sm ${active === tab.href ? 'bg-ink text-paper' : 'hover:text-clay'}`}
|
|
>
|
|
{tab.label}
|
|
</Link>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|