'use client'; import { useState } from "react"; const Currencies = [ 'USD', 'EUR', 'GBP', 'CAD', 'AUD', 'JPY', ]; export function CurrencySelector({ currency }: { currency: string; }) { const selectedCurrency = currency; const [isOpen, setIsOpen] = useState(false); const handleSelect = (currency: string) => { // navigate to the current page with the new currency as query param const newParams = new URLSearchParams(window.location.search); newParams.set('currency', currency); window.history.pushState({}, '', `${window.location.pathname}?${newParams}`); window.location.reload(); setIsOpen(false); } return (