import { useSession } from "next-auth/react"; import ClickAwayHandler from "@/components/ClickAwayHandler"; import { useState } from "react"; import useCollectionStore from "@/store/collections"; import { signOut } from "next-auth/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faPlus, faChevronDown, faFolder, faBox, faHashtag, faBookmark, faCircleUser, faSliders, faArrowRightFromBracket, } from "@fortawesome/free-solid-svg-icons"; import SidebarItem from "./SidebarItem"; import useTagStore from "@/store/tags"; import Link from "next/link"; import Dropdown from "@/components/Dropdown"; export default function () { const { data: session } = useSession(); const [collectionInput, setCollectionInput] = useState(false); const [profileDropdown, setProfileDropdown] = useState(false); const { collections, addCollection } = useCollectionStore(); const { tags } = useTagStore(); const user = session?.user; const toggleCollectionInput = () => { setCollectionInput(!collectionInput); }; const submitCollection = async ( event: React.KeyboardEvent ) => { const collectionName: string = (event.target as HTMLInputElement).value; if (event.key === "Enter" && collectionName) { addCollection(collectionName); (event.target as HTMLInputElement).value = ""; } }; return (
setProfileDropdown(!profileDropdown)} id="profile-dropdown" >

{user?.name}

{profileDropdown ? ( , }, { name: "Logout", icon: , onClick: () => { signOut(); setProfileDropdown(!profileDropdown); }, }, ]} onClickOutside={(e: Event) => { const target = e.target as HTMLInputElement; if (target.id !== "profile-dropdown") setProfileDropdown(false); }} className="absolute top-12 left-0" /> ) : null}

All Links

All Collections

Collections

{collectionInput ? ( ) : ( )}
{collections.map((e, i) => { return ( } path={`/collections/${e.id}`} /> ); })}

Tags

{tags.map((e, i) => { return ( } path={`/tags/${e.id}`} /> ); })}
); }