import Link from "next/link"; import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { getRelatedCases, getServicePage, servicePages, siteName, siteUrl, } from "@/lib/site-content"; interface ServicePageProps { params: Promise<{ slug: string; }>; } export function generateStaticParams() { return servicePages.map((service) => ({ slug: service.slug })); } export async function generateMetadata({ params, }: ServicePageProps): Promise { const { slug } = await params; const service = getServicePage(slug); if (!service) { return { title: `Servico nao encontrado | ${siteName}`, }; } const url = `${siteUrl}/servicos/${service.slug}`; return { title: service.seoTitle, description: service.metaDescription, alternates: { canonical: url, }, openGraph: { title: service.seoTitle, description: service.metaDescription, url, siteName, type: "article", }, twitter: { card: "summary_large_image", title: service.seoTitle, description: service.metaDescription, }, }; } export default async function ServicePage({ params }: ServicePageProps) { const { slug } = await params; const service = getServicePage(slug); if (!service) { notFound(); } const relatedCases = getRelatedCases(service.relatedCaseIds); const pageUrl = `${siteUrl}/servicos/${service.slug}`; const jsonLd = { "@context": "https://schema.org", "@graph": [ { "@type": "Service", "@id": `${pageUrl}#service`, name: service.navLabel, description: service.metaDescription, serviceType: service.navLabel, provider: { "@type": "Person", name: "Evandro Fonseca Junior", url: siteUrl, }, areaServed: [ { "@type": "Country", name: "Brasil", }, { "@type": "Place", name: "Remote worldwide", }, ], url: pageUrl, }, { "@type": "BreadcrumbList", itemListElement: [ { "@type": "ListItem", position: 1, name: "Inicio", item: siteUrl, }, { "@type": "ListItem", position: 2, name: "Servicos", item: `${siteUrl}/servicos`, }, { "@type": "ListItem", position: 3, name: service.navLabel, item: pageUrl, }, ], }, ], }; return (