import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { Info, ExternalLink, Loader2, AlertTriangle, Code, Globe, ScrollText } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { SettingsPageLayout } from '@/components/SettingsPageLayout'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { Card, CardContent } from '@/components/ui/card'; import { EmailSubscription } from '@/components/EmailSubscription'; export function AboutSettings() { const { t } = useTranslation(); const [license, setLicense] = useState(null); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { const fetchLicense = async () => { try { setIsLoading(true); setError(null); const response = await fetch('/LICENSE.html'); if (!response.ok) { throw new Error(`Failed to fetch license: ${response.status} ${response.statusText}`); } const licenseText = await response.text(); setLicense(licenseText); } catch (err) { console.error('Failed to fetch license:', err); setError(err instanceof Error ? err.message : 'Failed to fetch license'); } finally { setIsLoading(false); } }; fetchLicense(); }, []); return ( {/* Email Updates */}
{/* Mirrors */}
{t('mirrors')}

{t('mirrorsDescription')}

{/* Changelog */} {/* Project Information */} {/* License */}
{t('license')}
{isLoading ? (
{t('loadingLicense')}
) : error ? ( {t('failedToLoadLicense')}: {error} ) : license ? (
) : null}
{import.meta.env.VERSION && ( v{import.meta.env.VERSION}{import.meta.env.COMMIT_TAG ? '' : '+'} ({new Date(import.meta.env.BUILD_DATE).toLocaleDateString()}) )} ); } export default AboutSettings;