import React from 'react';
import { useTranslation } from 'react-i18next';
import DocumentRenderer from '../../components/common/DocumentRenderer';

const PrivacyPolicy = () => {
  const { i18n } = useTranslation();
  const lang = i18n.language.startsWith('en') ? 'en' : 'zh';

  return (
    <DocumentRenderer
      key={lang}
      apiEndpoint={`/api/privacy-policy?lang=${lang}`}
      title={i18n.language.startsWith('en') ? 'Privacy Policy' : '隐私政策'}
      cacheKey={`privacy_policy_${lang}`}
      emptyMessage={i18n.language.startsWith('en') ? 'Failed to load privacy policy...' : '加载隐私政策内容失败...'}
    />
  );
};

export default PrivacyPolicy;
