import { Avatar, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, NavbarItem, } from "@nextui-org/react"; import { UserType } from "@/types/UserType"; import { getCurrentJam, joinJam } from "@/helpers/jam"; import { JamType } from "@/types/JamType"; import { Dispatch, SetStateAction } from "react"; import { toast } from "react-toastify"; interface NavbarUserProps { user: UserType; jam?: JamType | null; setIsInJam: Dispatch>; isInJam?: boolean; } export default function MobileNavbarUser({ user, jam, setIsInJam, isInJam, }: NavbarUserProps) { return ( {jam && isInJam ? ( Create Game ) : null} {jam && !isInJam ? ( { try { const currentJam = await getCurrentJam(); if (!currentJam) { toast.error("There is no jam to join"); return; } if (await joinJam(currentJam.id)) { setIsInJam(true); } } catch (error) { console.error("Error during join process:", error); } }} > Join Event ) : null} Create Post Profile Settings Logout ); }