import { notFound } from "next/navigation"; import { readFile } from "node:fs/promises"; import { join } from "node:path"; import { parseMarkdownWithFrontmatter } from "@/lib/markdown"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; type Params = { params: { slug: string } }; export default async function FaqArticlePage({ params }: Params) { const root = process.cwd(); const file = join(root, "content", "pt", "perguntas", `${params.slug}.md`); try { const raw = await readFile(file); const { content, frontmatter } = parseMarkdownWithFrontmatter(raw.toString()); return (

{String(frontmatter.title ?? "FAQ")}

{frontmatter.readTime && Tempo de leitura: {String(frontmatter.readTime)}} {frontmatter.intendedFor && • Público: {String(frontmatter.intendedFor)}}

{content}
); } catch (e) { notFound(); } }