"use client";

import React from "react";
import { useLang } from "@/app/langContext";

const LanguageSwitcher: React.FC = () => {
  const { lang, setLanguage } = useLang();

  return (
    <div className="flex space-x-2 p-2">
      <button
        onClick={() => setLanguage("en")}
        className={`px-3 py-1 rounded-md text-sm transition-colors duration-200 ${
          lang === "en"
            ? "bg-primary-cta text-primary-cta-foreground" : "bg-transparent text-foreground hover:bg-muted"}
        `}
      >
        English
      </button>
      <button
        onClick={() => setLanguage("ku")}
        className={`px-3 py-1 rounded-md text-sm transition-colors duration-200 ${
          lang === "ku"
            ? "bg-primary-cta text-primary-cta-foreground" : "bg-transparent text-foreground hover:bg-muted"}
        `}
      >
        کوردی
      </button>
    </div>
  );
};

export default LanguageSwitcher;