'use client'
import { useState } from 'react'
import type { I18nConfig } from './types.js'
import { useAlternateLinks } from './AlternateLinksContext.js'
export type LanguageSwitcherClassNames = {
item?: string
itemActive?: string
menu?: string
root?: string
trigger?: string
}
type LocaleItem = { code: string; label: string }
/**
* Language switcher that links to the CORRECT localized URL per language,
* reading the current page's alternates from AlternateLinksProvider — so it
* never 404s on differing slugs (/pl/uslugi vs /en/services).
*
* Unstyled by default (classNames, like CookieBanner) — NOT a fixed
* light/dark variant, so it matches any project's design. A locale with no
* known alternate falls back to its root (/{code}).
*
* // layout/header (client), inside AlternateLinksProvider
*