'use client'; import { useTranslations } from 'next-intl'; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useTheme } from 'next-themes'; import { motion } from 'framer-motion'; import { ArrowLeft, Sun, Moon, Monitor, Languages, Check } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Label } from '@/components/ui/label'; import { cn } from '@/lib/utils'; interface PreferencesContentProps { locale: string; } const themes = [ { value: 'light', icon: Sun, labelKey: 'lightMode' }, { value: 'dark', icon: Moon, labelKey: 'darkMode' }, { value: 'system', icon: Monitor, labelKey: 'systemDefault' }, ] as const; const languages = [ { value: 'de', label: 'Deutsch', flag: 'DE' }, { value: 'en', label: 'English', flag: 'EN' }, ] as const; /** * Preferences settings content - Theme and language settings */ export function PreferencesContent({ locale }: PreferencesContentProps) { const t = useTranslations('settings'); const { theme, setTheme } = useTheme(); const router = useRouter(); const pathname = usePathname(); const handleLanguageChange = (newLocale: string) => { if (newLocale === locale) return; // Replace the locale in the current path const newPath = pathname.replace(`/${locale}`, `/${newLocale}`); router.push(newPath); }; return (
{/* Header with back button */}

{t('preferencesTitle')}

{t('preferencesDescription')}

{/* Theme Selection */} {t('theme')} Waehlen Sie Ihr bevorzugtes Farbschema
{themes.map((themeOption) => { const Icon = themeOption.icon; const isSelected = theme === themeOption.value; return ( ); })}
{/* Language Selection */} {t('language')} Waehlen Sie Ihre bevorzugte Sprache
{languages.map((lang) => { const isSelected = locale === lang.value; return ( ); })}
{/* Dashboard Preferences */} Dashboard Einstellungen fuer Ihr Dashboard

Setzen Sie Ihr Dashboard auf die Standardkonfiguration zurueck

); }