12/02/2026

This commit is contained in:
2026-02-12 17:14:04 +07:00
parent 2bc93383a0
commit 756cf6410c
35 changed files with 784 additions and 299 deletions

View File

@@ -0,0 +1,37 @@
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { findBySlug } from "@/lib/slug/slugMap";
import { metadataBySlug } from "@/app/[slug]/metadataBySlug";
import { SLUG_CONFIG } from "@/app/[slug]/slugConfig";
import { renderBySlug } from "@/app/[slug]/renderBySlug";
import LayoutTypeSetter from "@/components/layout/LayoutTypeSetter"
export async function generateMetadata({
params,
}: {
params: Promise<{ slug: string }>;
}): Promise<Metadata> {
const { slug } = await params;
const result = await findBySlug(slug);
return metadataBySlug(result);
}
export default async function SlugPage({ params }: { params: { slug: string } }) {
const { slug } = await params;
const result = await findBySlug(slug);
if (!result) notFound();
const config = SLUG_CONFIG[result.type];
if (!config) notFound();
return (
<LayoutTypeSetter layout="main">
{renderBySlug(result)}
</LayoutTypeSetter>
);
}