import Link from 'next/link'; import { notFound } from 'next/navigation'; import { ArrowLeft, ArrowRight } from 'lucide-react'; import Header from '../../../components/Header.jsx'; import Footer from '../../../components/Footer.jsx'; import Reveal from '../../../components/Reveal.jsx'; import { serverApi } from '../../../lib/serverApi.js'; import { getOrganizationSchema } from '../../../lib/schema.js'; export async function generateMetadata({ params }) { const faq = await serverApi.getFaq(params.slug); if (!faq) return { title: 'Вопрос не найден' }; return { title: faq.question, description: faq.answer.length > 160 ? `${faq.answer.slice(0, 157)}...` : faq.answer, alternates: { canonical: `/faq/${params.slug}` }, }; } export default async function FaqDetailPage({ params }) { const [faq, orgSchema] = await Promise.all([serverApi.getFaq(params.slug), getOrganizationSchema()]); if (!faq) notFound(); const faqSchema = { '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: [ { '@type': 'Question', name: faq.question, acceptedAnswer: { '@type': 'Answer', text: faq.answer }, }, ], }; return (
{/* eslint-disable-next-line react/no-danger */}