import { Button, Popover, PopoverContent, PopoverTrigger, useIsMobile, } from "@methanium/ui"; import { ArrowLeft, EllipsisVertical, House, Phone, Settings, User, } from "lucide-react"; import { useLocation, useNavigate, useSearch } from "@tanstack/react-router"; import { useCall } from "@tensamin/call/state"; import Wrapper from "@tensamin/identity/wrapper"; import { Skeleton } from "@methanium/ui"; import { Select, SelectContent, SelectItem, SelectTrigger, } from "@methanium/ui"; import { displayCallId } from "@tensamin/call/utils"; import { useState } from "react"; import { SidebarTrigger, useSidebar } from "@methanium/ui"; import { WindowControls as Controls } from "@methanium/ui"; import { useSession } from "@tensamin/identity/session"; import Profile from "./modals/profile"; export default function Navbar({ forMobile }: { forMobile: boolean }) { const navigate = useNavigate(); const callState = useCall((state) => state.state); const { calls } = useSession(); const { pathname } = useLocation(); const { id } = useSearch({ strict: false }); const currentCalls = calls.filter((call) => call.CallMembers.some((member) => member === id), ); const isMobile = useIsMobile(); const [userInfoOpen, setUserInfoOpen] = useState(false); const { callId } = useCall(); return (
{forMobile ? ( ( )} /> ) : ( <> )} {isMobile && pathname === "/call" && callId && (

{displayCallId(callId)}

)} {pathname === "/chat" && id && ( isMobile ? (

{user?.Display}

) : ( ( )} /> ) } loading={} /> )}
{/* Empty space */}
{pathname === "/chat" && id && ( <> {currentCalls.length === 0 ? ( ) : currentCalls.length === 1 ? ( ) : ( <> )} )} {isMobile && pathname === "/call" && callId && ( )}
); } export function MobileNavbar() { const navigate = useNavigate(); const { setOpenMobile } = useSidebar(); return (

Chats

); }