import { RADIO, versionNum } from "@/logic/constants";
import { useLocation } from "wouter";
import useLocalState from "@/state/state";
import key from "@/assets/icons/key.svg";
import logo from "@/assets/icons/logo.png";
import home from "@/assets/icons/home.svg";
import bell from "@/assets/icons/bell.svg";
import settings from "@/assets/icons/settings.svg";
import messages from "@/assets/icons/messages.svg";
import profile from "@/assets/icons/profile.svg";
import pals from "@/assets/icons/pals.svg";
import rumors from "@/assets/icons/rumors.svg";
import { ThemeSwitcher } from "@/styles/ThemeSwitcher";

function SlidingMenu() {
  const [_, navigate] = useLocation();
  const { api } = useLocalState();
  function goto(to: string) {
    navigate(to);
  }
  return (
    <div id="left-menu">
      <div id="logo">
        <img src={logo} />
        <h3> Nostrill </h3>
      </div>
      <h3>Feeds</h3>
      <div className="opt" role="link" onClick={() => goto(`/feed/global`)}>
        <img src={home} alt="" />
        <div>Home</div>
      </div>
      <div className="opt" role="link" onClick={() => goto(`/hark`)}>
        <img src={bell} alt="" />
        <div>Activity</div>
      </div>
      <hr />

      <div className="opt" role="link" onClick={() => goto("/chat")}>
        <img src={messages} alt="" />
        <div>Messages</div>
      </div>
      <div className="opt" role="link" onClick={() => goto("/pals")}>
        <img src={pals} alt="" />
        <div>Pals</div>
      </div>
      <hr />
      <div
        className="opt"
        role="link"
        onClick={() => goto(`/feed/${api!.airlock.our}`)}
      >
        <img src={profile} alt="" />
        <div>Profile</div>
      </div>
      <div className="opt" role="link" onClick={() => goto("/feed/anon")}>
        <img src={rumors} alt="" />
        <div>Rumors</div>
      </div>
      <hr />
      <div className="opt" role="link" onClick={() => goto("/radio")}>
        <div className="img">{RADIO}</div>
        <div>Radio</div>
      </div>
      <hr />
      <div
        className="opt"
        role="link"
        onClick={() => (window.location.href = "/cookies")}
      >
        <img src={key} alt="" />
        <div>Logins</div>
      </div>
      <div className="opt" role="link" onClick={() => goto("/sets")}>
        <img src={settings} alt="" />
        <div>Settings</div>
      </div>
      <ThemeSwitcher />
    </div>
  );
}
export default SlidingMenu;
