MCPcopy
hub / github.com/Dokploy/dokploy / SidebarLogo

Function SidebarLogo

apps/dokploy/components/layouts/side.tsx:548–869  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

546}
547
548function SidebarLogo() {
549 const { state } = useSidebar();
550 const { data: isCloud } = api.settings.isCloud.useQuery();
551 const { data: user } = api.user.get.useQuery();
552 const { data: session } = api.user.session.useQuery();
553 const {
554 data: organizations,
555 refetch,
556 isLoading,
557 } = api.organization.all.useQuery();
558 const { mutateAsync: deleteOrganization, isPending: isRemoving } =
559 api.organization.delete.useMutation();
560 const { mutateAsync: setDefaultOrganization, isPending: isSettingDefault } =
561 api.organization.setDefault.useMutation();
562 const { isMobile } = useSidebar();
563 const isCollapsed = state === "collapsed" && !isMobile;
564 const { data: activeOrganization } = api.organization.active.useQuery();
565
566 const { data: invitations, refetch: refetchInvitations } =
567 api.user.getInvitations.useQuery();
568
569 const [_activeTeam, setActiveTeam] = useState<
570 typeof activeOrganization | null
571 >(null);
572
573 useEffect(() => {
574 if (activeOrganization) {
575 setActiveTeam(activeOrganization);
576 }
577 }, [activeOrganization]);
578
579 return (
580 <>
581 {isLoading ? (
582 <div className="flex flex-row gap-2 items-center justify-center text-sm text-muted-foreground min-h-[5vh] pt-4">
583 <Loader2 className="animate-spin size-4" />
584 </div>
585 ) : (
586 <SidebarMenu
587 className={cn(
588 "flex gap-2",
589 isCollapsed ? "flex-col" : "flex-row justify-between items-center",
590 )}
591 >
592 {/* Organization Logo and Selector */}
593 <SidebarMenuItem className={"w-full"}>
594 <DropdownMenu>
595 <DropdownMenuTrigger asChild>
596 <SidebarMenuButton
597 size={isCollapsed ? "sm" : "lg"}
598 className={cn(
599 "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
600 isCollapsed &&
601 "flex justify-center items-center p-2 h-10 w-10 mx-auto",
602 )}
603 >
604 <div
605 className={cn(

Callers

nothing calls this directly

Calls 2

useSidebarFunction · 0.90
cnFunction · 0.90

Tested by

no test coverage detected