'use client'; import { useState } from 'react'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Settings, Trash2, Loader2, FileSpreadsheet, FileText, Presentation, } from 'lucide-react'; import { useI18n } from '@/lib/i18n'; export default function GeneralSettingsPage() { const { t } = useI18n(); const [isClearing, setIsClearing] = useState(false); const handleClearCache = async () => { setIsClearing(true); try { localStorage.removeItem('translation-settings'); sessionStorage.clear(); if ('caches' in window) { const cacheNames = await caches.keys(); await Promise.all(cacheNames.map(name => caches.delete(name))); } await new Promise(resolve => setTimeout(resolve, 500)); window.location.reload(); } catch (error) { console.error('Error clearing cache:', error); setIsClearing(false); } }; const formats = [ { icon: , name: 'Excel', ext: '.xlsx, .xls', features: [t('settings.formats.formulas'), t('settings.formats.styles'), t('settings.formats.images')] }, { icon: , name: 'Word', ext: '.docx, .doc', features: [t('settings.formats.headers'), t('settings.formats.tables'), t('settings.formats.images')] }, { icon: , name: 'PowerPoint', ext: '.pptx, .ppt', features: [t('settings.formats.slides'), t('settings.formats.notes'), t('settings.formats.images')] }, ]; return (

{t('settings.title')}

{t('settings.subtitle')}

{/* Supported Formats */}
{t('settings.formats.title')} {t('settings.formats.subtitle')}
{formats.map((f) => (
{f.icon}

{f.name}

{f.ext}

{f.features.map(ft => ( {ft} ))}
))}
{/* Danger zone */} {t('settings.cache.title')}

{t('settings.cache.desc')}

); }