"use client"

import { useState } from "react"

import { ChevronDownIcon, GlobeIcon } from "@/components/Icons"

import Button from "../Button"

import styles from "./languageSwitcher.module.css"

export default function LanguageSwitcher() {
  const [isExpanded, setIsExpanded] = useState(false)

  function handleButtonClick() {
    setIsExpanded((prev) => !prev)
  }

  return (
    <Button onClick={handleButtonClick}>
      <GlobeIcon width={20} height={20} color="burgundy" />
      <span>English</span>
      <ChevronDownIcon
        className={`${styles.chevron} ${isExpanded ? styles.isExpanded : ""}`}
        width={20}
        height={20}
        color="burgundy"
      />
    </Button>
  )
}
