"use client";

import { useLanguage } from "@/context/language-provider";
import { Button } from "@/components/ui/button";
import { Languages } from "lucide-react";

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

  return (
    <Button
      variant="ghost"
      size="sm"
      className="flex items-center gap-2 px-2 h-9"
      onClick={() => setLanguage(language === "en" ? "ar" : "en")}
    >
      <Languages className="w-4 h-4" />
      <span className="text-sm font-medium">
        {language === "en" ? "العربية" : "English"}
      </span>
    </Button>
  );
}
