import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { Info, ExternalLink, Loader2, AlertTriangle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Alert, AlertDescription } from '@/components/ui/alert'; 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.txt'); 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 (

{t('aboutShakespeare')}

{t('aboutShakespeareDescription')}

{/* Project Information */} {t('sourceCode')} {/* License */} {t('license')} {isLoading ? (
{t('loadingLicense')}
) : error ? ( {t('failedToLoadLicense')}: {error} ) : license ? (
                  {license}
                
) : null}
); } export default AboutSettings;