import { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Info, ExternalLink, Loader2, AlertTriangle, ArrowLeft, Code, Globe } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { useIsMobile } from '@/hooks/useIsMobile'; import { EmailSubscription } from '@/components/EmailSubscription'; export function AboutSettings() { const { t } = useTranslation(); const navigate = useNavigate(); const isMobile = useIsMobile(); 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 (
{isMobile && (

{t('aboutShakespeare')}

{t('aboutShakespeareDescription')}

)} {!isMobile && (

{t('aboutShakespeare')}

{t('aboutShakespeareDescription')}

)}
{/* Email Updates */}
{/* Mirrors */}
{t('mirrors')}

{t('mirrorsDescription')}

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