18 lines
596 B
TypeScript
18 lines
596 B
TypeScript
import { notFound } from 'next/navigation';
|
|
import { getRecipe } from '@/lib/repository';
|
|
import { admin } from '@/lib/server';
|
|
import { Cooking } from '@/components/cooking';
|
|
export const dynamic = 'force-dynamic';
|
|
export const metadata = { title: 'Jetzt kochen' };
|
|
export default async function Cook({
|
|
params,
|
|
searchParams,
|
|
}: {
|
|
params: Promise<{ id: string }>;
|
|
searchParams: Promise<{ faktor?: string }>;
|
|
}) {
|
|
const r = await getRecipe((await params).id, !!(await admin()));
|
|
if (!r) notFound();
|
|
return <Cooking recipe={r} initialFactor={(await searchParams).faktor ?? '1'} />;
|
|
}
|