'use client';

import React from 'react';
import { useI18n } from '@/i18n/I18nContext';

const LanguageSwitcher = () => {
    const { locale, setLocale } = useI18n();

    return (
        <div className="flex items-center gap-2">
            <button
                onClick={() => setLocale('de')}
                className={`p-1.5 rounded-lg transition-all ${locale === 'de'
                    ? 'bg-orange-950/30 scale-110 shadow-sm shadow-orange-950/20'
                    : 'opacity-50 hover:opacity-100 grayscale hover:grayscale-0'
                    }`}
                title="Deutsch"
            >
                <span className="text-lg">🇩🇪</span>
            </button>
            <button
                onClick={() => setLocale('en')}
                className={`p-1.5 rounded-lg transition-all ${locale === 'en'
                    ? 'bg-orange-950/30 scale-110 shadow-sm shadow-orange-950/20'
                    : 'opacity-50 hover:opacity-100 grayscale hover:grayscale-0'
                    }`}
                title="English"
            >
                <span className="text-lg">🇬🇧</span>
            </button>
        </div>
    );
};

export default LanguageSwitcher;
