import { LogoHeader } from "./LogoHeader";
import { useNavigate } from "react-router-dom";
import Icon from "@/Icons/Icon";
import { ProfileLink } from "../../Element/User/ProfileLink";
import Avatar from "../../Element/User/Avatar";
import useLogin from "../../Hooks/useLogin";
import { useUserProfile } from "@snort/system-react";
import { NoteCreatorButton } from "../../Element/Event/Create/NoteCreatorButton";
import { FormattedMessage, useIntl } from "react-intl";
import classNames from "classnames";
import { getCurrentSubscription } from "@/Subscription";
import { HasNotificationsMarker } from "@/Pages/Layout/HasNotificationsMarker";
import NavLink from "@/Element/Button/NavLink";
const MENU_ITEMS = [
{
label: "Home",
icon: "home",
link: "/",
nonLoggedIn: true,
},
{
label: "Search",
icon: "search",
link: "/search",
nonLoggedIn: true,
},
{
label: "Notifications",
icon: "bell-02",
link: "/notifications",
},
{
label: "Messages",
icon: "mail",
link: "/messages",
},
{
label: "Deck",
icon: "deck",
link: "/deck",
},
{
label: "Social Graph",
icon: "graph",
link: "/graph",
},
{
label: "About",
icon: "info",
link: "/donate",
nonLoggedIn: true,
},
{
label: "Settings",
icon: "settings",
link: "/settings",
},
];
const getNavLinkClass = (isActive: boolean, narrow: boolean) => {
const c = isActive
? "py-4 hover:no-underline flex flex-row items-center text-nostr-purple"
: "py-4 hover:no-underline hover:text-nostr-purple flex flex-row items-center";
return classNames(c, { "xl:ml-1": !narrow });
};
export default function NavSidebar({ narrow = false }) {
const { publicKey, subscriptions, readonly } = useLogin(s => ({
publicKey: s.publicKey,
subscriptions: s.subscriptions,
readonly: s.readonly,
}));
const profile = useUserProfile(publicKey);
const navigate = useNavigate();
const sub = getCurrentSubscription(subscriptions);
const { formatMessage } = useIntl();
const className = classNames(
{ "xl:w-56 xl:gap-3 xl:items-start": !narrow },
"overflow-y-auto hide-scrollbar sticky items-center border-r border-neutral-900 top-0 z-20 h-screen max-h-screen hidden md:flex flex-col px-2 py-4 flex-shrink-0 gap-2",
);
const readOnlyIcon = readonly && (