import { Calendar, ChevronLeft, Clock } from 'lucide-react'; import { Link, useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import SEOHead from '@/components/seo/SEOHead'; import { getToolSEO } from '@/config/seoData'; import { BLOG_ARTICLES, getBlogArticleBySlug, getLocalizedBlogArticle, normalizeBlogLocale, } from '@/content/blogArticles'; import { generateBlogPosting, generateBreadcrumbs, generateWebPage, getSiteOrigin } from '@/utils/seo'; import NotFoundPage from './NotFoundPage'; export default function BlogPostPage() { const { slug } = useParams(); const { t, i18n } = useTranslation(); const locale = normalizeBlogLocale(i18n.language); const article = slug ? getBlogArticleBySlug(slug) : undefined; const siteOrigin = getSiteOrigin(typeof window !== 'undefined' ? window.location.origin : ''); if (!article) { return ; } const localizedArticle = getLocalizedBlogArticle(article, locale); const path = `/blog/${localizedArticle.slug}`; const url = `${siteOrigin}${path}`; const breadcrumbs = generateBreadcrumbs([ { name: t('common.home'), url: siteOrigin }, { name: t('common.blog'), url: `${siteOrigin}/blog` }, { name: localizedArticle.title, url }, ]); const relatedArticles = BLOG_ARTICLES .filter((candidate) => candidate.slug !== article.slug) .slice(0, 3) .map((candidate) => getLocalizedBlogArticle(candidate, locale)); return ( <>
{t('pages.blog.backToBlog')}
{localizedArticle.category} {localizedArticle.publishedAt} {t('pages.blog.readTime', { count: localizedArticle.readingMinutes })}

{localizedArticle.title}

{localizedArticle.excerpt}

{t('pages.blog.keyTakeaways')}

    {localizedArticle.keyTakeaways.map((item) => (
  • • {item}
  • ))}
{localizedArticle.sections.map((section) => (

{section.heading}

{section.paragraphs.map((paragraph) => (

{paragraph}

))}
{section.bullets.length > 0 && (
    {section.bullets.map((bullet) => (
  • • {bullet}
  • ))}
)}
))}
); }