feat(accounts): hesaplar (KMH, kredi kartı, yemek kartı, yalnızca ben)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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"}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user