"use client"; import * as React from "react"; import { cn } from "./lib/utils"; export interface CurrencyOption { code: string; symbol: string; label: string; } export const CURRENCIES: CurrencyOption[] = [ { code: "TRY", symbol: "₺", label: "Turkish Lira" }, { code: "USD", symbol: "$", label: "US Dollar" }, { code: "EUR", symbol: "€", label: "Euro" }, { code: "GBP", symbol: "£", label: "Sterlin" }, ]; export interface CurrencySelectProps extends Omit, "onChange"> { value?: string; defaultValue?: string; onValueChange?: (code: string) => void; } /** Currency selector dropdown with symbols and currency codes. */ export function CurrencySelect({ value, defaultValue, onValueChange, className, ...props }: CurrencySelectProps) { const [internal, setInternal] = React.useState(defaultValue ?? "TRY"); const [open, setOpen] = React.useState(false); const active = CURRENCIES.find((c) => c.code === (value ?? internal)) ?? CURRENCIES[0]; return (
{open && ( <>
setOpen(false)} aria-hidden="true" />
    {CURRENCIES.map((c) => (
  • ))}
)}
); }