Files
gastro-bot/src/app/[locale]/faq/page.tsx
Samandar Turgunboyev c2a4064951 seo uodate
2025-12-23 12:18:53 +05:00

78 lines
2.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// app/faq/page.tsx
import { faq_api } from '@/features/faq/lib/api';
import Faq from '@/features/faq/ui/Faq';
import { Metadata } from 'next';
import { Suspense } from 'react';
// FAQ ma'lumotini API dan olish
const fetchFaqData = async () => {
try {
const res = await faq_api.list();
return res.data;
} catch {
return [];
}
};
interface PageProps {
params: {
locale: 'uz' | 'ru';
};
}
// Dynamic metadata generatsiyasi
export async function generateMetadata({
params,
}: PageProps): Promise<Metadata> {
const { locale } = await params;
const data = await fetchFaqData();
const faqCount = data.length;
if (locale === 'ru') {
return {
title: `FAQ | Часто задаваемые вопросы`,
description: `В нашем разделе FAQ ${faqCount} часто задаваемых вопросов с ответами.`,
keywords: `faq, часто задаваемые вопросы, ответы, gastro market`,
openGraph: {
title: `FAQ | Часто задаваемые вопросы`,
description: `В нашем разделе FAQ ${faqCount} часто задаваемых вопросов с ответами.`,
siteName: 'Gastro Market',
type: 'website',
},
twitter: {
card: 'summary_large_image',
title: `FAQ | Часто задаваемые вопросы`,
description: `В нашем разделе FAQ ${faqCount} часто задаваемых вопросов с ответами.`,
},
};
}
// default: Uzbek
return {
title: `FAQ | Tez-tez So'raladigan Savollar`,
description: `Bizning FAQ bo'limimizda ${faqCount} ta tez-tez so'raladigan savollarga javoblar.`,
keywords: `faq, tez-tez so'raladigan savollar, javoblar, gastro market`,
openGraph: {
title: `FAQ | Tez-tez So'raladigan Savollar`,
description: `Bizning FAQ bo'limimizda ${faqCount} ta tez-tez so'raladigan savollarga javoblar.`,
siteName: 'Gastro Market',
type: 'website',
},
twitter: {
card: 'summary_large_image',
title: `FAQ | Tez-tez So'raladigan Savollar`,
description: `Bizning FAQ bo'limimizda ${faqCount} ta tez-tez so'raladigan savollarga javoblar.`,
},
};
}
const Page = () => {
return (
<Suspense>
<Faq />
</Suspense>
);
};
export default Page;