8dd5fd42e3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { notFound } from "next/navigation";
|
|
import { PageHeader } from "@/components/page-header";
|
|
import { AccountsView } from "@/features/accounts/components/accounts-view";
|
|
import { listAccounts, listMemberOptions } from "@/features/accounts/service";
|
|
import { tr } from "@/i18n/tr";
|
|
import { requireActiveHousehold } from "@/lib/dal";
|
|
|
|
export const metadata: Metadata = { title: tr.accounts.title };
|
|
|
|
export default async function AccountsPage() {
|
|
const { user, household } = await requireActiveHousehold("viewer");
|
|
const [data, members] = await Promise.all([
|
|
listAccounts(user.id, household.id, { includeArchived: true }),
|
|
listMemberOptions(user.id, household.id),
|
|
]);
|
|
if (!data || !members) notFound();
|
|
return (
|
|
<>
|
|
<PageHeader title={tr.accounts.title} description={tr.accounts.description} />
|
|
<AccountsView
|
|
accounts={data.accounts}
|
|
totals={data.totals}
|
|
members={members}
|
|
canEdit={household.role === "owner"}
|
|
/>
|
|
</>
|
|
);
|
|
}
|