import { useSession } from "next-auth/react"; import ClickAwayHandler from "@/components/ClickAwayHandler"; import { useState } from "react"; import useCollectionSlice from "@/store/collection"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faUserCircle } from "@fortawesome/free-regular-svg-icons"; import { faPlus, faChevronDown, faFolder, faBoxesStacked, faHashtag, faBookmark, } from "@fortawesome/free-solid-svg-icons"; import SidebarItem from "./SidebarItem"; import useTagSlice from "@/store/tags"; export default function () { const { data: session } = useSession(); const [collectionInput, setCollectionInput] = useState(false); const { collections, addCollection } = useCollectionSlice(); const { tags } = useTagSlice(); 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 (

{user?.name}

Collections

{collectionInput ? ( ) : ( )}
{collections.map((e, i) => { return ; })}

Tags

{tags.map((e, i) => { return ; })}
); }