212d6f7335
Root layout used title.template ("%s | Epicure") and 38 pages set
their own title, producing "Recipes | Epicure", "Messages — Epicure",
etc. Drop the template, set a flat "Epicure" default, and clear every
page's title override so they all inherit it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
31 lines
936 B
TypeScript
31 lines
936 B
TypeScript
import type { Metadata } from "next";
|
|
import { headers } from "next/headers";
|
|
import { auth } from "@/lib/auth/server";
|
|
import { db, collections, eq, desc } from "@epicure/db";
|
|
import { CollectionsPageContent } from "@/components/collections/collections-page-content";
|
|
|
|
export const metadata: Metadata = {};
|
|
|
|
export default async function CollectionsPage() {
|
|
const session = await auth.api.getSession({ headers: await headers() });
|
|
if (!session) return null;
|
|
|
|
const userCollections = await db.query.collections.findMany({
|
|
where: eq(collections.userId, session.user.id),
|
|
orderBy: desc(collections.updatedAt),
|
|
with: { recipes: { limit: 1 } },
|
|
});
|
|
|
|
return (
|
|
<CollectionsPageContent
|
|
collections={userCollections.map((col) => ({
|
|
id: col.id,
|
|
name: col.name,
|
|
description: col.description,
|
|
isPublic: col.isPublic,
|
|
recipeCount: col.recipes.length,
|
|
}))}
|
|
/>
|
|
);
|
|
}
|