import React from 'react';
import StaticPageScaffold from '@/components/layout/StaticPageScaffold.tsx';
import { useTranslation } from '@/hooks/useI18n.tsx';

interface PrivacySection {
  title: string;
  content: string;
}

const PrivacyPage = () => {
  const { t, t_raw } = useTranslation();

  // The translation key 'privacyPage.sections' should return an array of {title, content} objects
  const sections = t_raw('privacyPage.sections') as PrivacySection[];

  return (
    <StaticPageScaffold title={t('footer.links.privacy')}>
      <p>
        <em>{t('privacyPage.lastUpdated', { date: new Date().toLocaleDateString('ru-RU') })}</em>
      </p>

      {Array.isArray(sections) &&
        sections.map((section, index) => (
          <React.Fragment key={index}>
            <h2>{section.title}</h2>
            <p>{section.content}</p>
          </React.Fragment>
        ))}
    </StaticPageScaffold>
  );
};

export default PrivacyPage;
