This commit is contained in:
@@ -5,8 +5,9 @@ import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { PageHero } from "@/components/layout/page-hero";
|
||||
import { PortfolioProjectDetail } from "@/components/site/portfolio-project-detail";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
|
||||
import {
|
||||
getLocalizedValue,
|
||||
getPublishedPortfolioProjectBySlug,
|
||||
@@ -23,7 +24,7 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: PortfolioItemPageProps): Promise<Metadata> {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale);
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const item = await getPublishedPortfolioProjectBySlug(slug);
|
||||
|
||||
if (!item) {
|
||||
@@ -47,14 +48,17 @@ export default async function PortfolioItemPage({
|
||||
params,
|
||||
}: PortfolioItemPageProps) {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale);
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const item = await getPublishedPortfolioProjectBySlug(slug);
|
||||
|
||||
if (!item) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioDetail" });
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "portfolioDetail" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -64,7 +68,12 @@ export default async function PortfolioItemPage({
|
||||
/>
|
||||
|
||||
<Container size="wide" className="pb-12 lg:pb-16">
|
||||
<PortfolioProjectDetail item={item} locale={localeKey} t={t} />
|
||||
<PortfolioProjectDetail
|
||||
item={item}
|
||||
locale={localeKey}
|
||||
defaultLocale={siteSettings.defaultLocale}
|
||||
t={t}
|
||||
/>
|
||||
</Container>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user