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

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

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

export default UsagePolicy;
