import { Globe } from 'lucide-react';
import { Button } from './ui/button';
import { useLanguage } from '../lib/languageContext';

export function LanguageSwitcher() {
  const { language, setLanguage } = useLanguage();

  const toggleLanguage = () => {
    setLanguage(language === 'en' ? 'ar' : 'en');
  };

  return (
    <Button variant="ghost" onClick={toggleLanguage} className="gap-2">
      <Globe className="h-4 w-4" />
      <span>{language === 'en' ? 'العربية' : 'English'}</span>
    </Button>
  );
}