"use client";

import { Connection } from "./_components/Connection";
/* import { ThemeSwap } from "./ThemeSwap"; */
import { Audio } from "../../../_components/Audio/Audio";
/* import { useState } from "react"; */
import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons";
import Link from "next/link";
import { Settings } from "_components/navbar/Settings";
import ModeSwitchDropdown from "_components/navbar/ModeSwitchDropdown";

export default function Navbar() {
	/* const [isDark, setIsDark] = useState(false);

	const toggleTheme = () => {
		const newTheme = !isDark;
		setIsDark(newTheme);
		document.documentElement.setAttribute(
			"data-theme",
			newTheme ? "nord" : "dark",
		);
	}; */

	return (
		<div className="navbar bg-base-100 shadow-sm flex gap-5 justify-between">
			<ModeSwitchDropdown />
			<div className="flex items-center gap-5">
				<div className="flex items-center gap-2">
					<Audio />
				</div>
				<div className="flex items-center">
					<Connection />
				</div>
				{/* <ThemeSwap isDark={isDark} toggleTheme={toggleTheme} /> */}
				<div className="flex items-center">
					<Settings />
					<Link
						href={process.env.NEXT_PUBLIC_HUB_URL || "#!"}
						target="_blank"
						rel="noopener noreferrer"
					>
						<button className="btn btn-ghost">
							<ExternalLinkIcon className="w-4 h-4" /> HUB
						</button>
					</Link>
					<Link href={"/logout"}>
						<button className="btn btn-ghost">
							<ExitIcon className="w-4 h-4" />
						</button>
					</Link>
				</div>
			</div>
		</div>
	);
}
