- Rename /news route to /blog across all pages, links, and sitemap - Fix hardcoded English text in Experiences, QuoteSection, and Footer by wiring all content through the TR/EN dictionaries - Clean up Footer: remove non-existent page links, add contact column - Update contact info: new phone numbers, bilgi@ email, No:71 address, Instagram @ayrisapart link - Add suppressHydrationWarning to <body> to silence browser-extension attribute mismatch errors - Add sizes prop to all fill-mode Next.js Image components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
925 B
TypeScript
33 lines
925 B
TypeScript
import { getDictionary } from "@/dictionaries/get-dictionary"
|
|
import NewsDetailClient from "./NewsDetailClient"
|
|
import { prisma } from "@/lib/prisma"
|
|
import { notFound } from "next/navigation"
|
|
|
|
export async function generateMetadata({ params }: { params: Promise<{ lang: string, slug: string }> }) {
|
|
const { lang, slug } = await params
|
|
|
|
const post = await prisma.post.findUnique({
|
|
where: { slug }
|
|
})
|
|
|
|
if (!post) return { title: 'Post Not Found' }
|
|
|
|
return {
|
|
title: `${post.title} - Ayris Apart`,
|
|
description: post.excerpt,
|
|
}
|
|
}
|
|
|
|
export default async function NewsDetailPage({ params }: { params: Promise<{ lang: string, slug: string }> }) {
|
|
const { lang, slug } = await params
|
|
const dict = await getDictionary(lang as 'en' | 'tr')
|
|
|
|
const post = await prisma.post.findUnique({
|
|
where: { slug }
|
|
})
|
|
|
|
if (!post) notFound()
|
|
|
|
return <NewsDetailClient lang={lang} dict={dict} post={post} />
|
|
}
|