d52f41ab0c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1010 B
TypeScript
26 lines
1010 B
TypeScript
import type { Metadata } from "next";
|
||
import { notFound } from "next/navigation";
|
||
import { PageHeader } from "@/components/page-header";
|
||
import { StoresView } from "@/features/stores/components/stores-view";
|
||
import { listStores } from "@/features/stores/service";
|
||
import { tr } from "@/i18n/tr";
|
||
import { requireActiveHousehold } from "@/lib/dal";
|
||
|
||
export const metadata: Metadata = { title: tr.stores.title };
|
||
|
||
/** /magazalar — marketler, online platformlar ve pazarlar; uzaklık, taşıma ve zahmet skoru. */
|
||
export default async function StoresPage() {
|
||
const { user, household } = await requireActiveHousehold("viewer");
|
||
const data = await listStores(user.id, household.id);
|
||
if (!data) notFound();
|
||
return (
|
||
<>
|
||
<PageHeader title={tr.stores.title} description={tr.stores.description} />
|
||
{!data.canWrite ? (
|
||
<p className="text-sm text-muted-foreground">{tr.stores.readOnly}</p>
|
||
) : null}
|
||
<StoresView stores={data.stores} canWrite={data.canWrite} />
|
||
</>
|
||
);
|
||
}
|