MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / SidebarMenuSkeleton

Function SidebarMenuSkeleton

packages/react/src/components/sidebar.tsx:574–605  ·  view source on GitHub ↗
({
  className,
  showIcon = false,
  ...props
}: React.ComponentProps<"div"> & {
  showIcon?: boolean;
})

Source from the content-addressed store, hash-verified

572}
573
574function SidebarMenuSkeleton({
575 className,
576 showIcon = false,
577 ...props
578}: React.ComponentProps<"div"> & {
579 showIcon?: boolean;
580}) {
581 // Random width between 50 to 90%.
582 const width = React.useMemo(() => {
583 return `${Math.floor(Math.random() * 40) + 50}%`;
584 }, []);
585
586 return (
587 <div
588 data-slot="sidebar-menu-skeleton"
589 data-sidebar="menu-skeleton"
590 className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
591 {...props}
592 >
593 {showIcon && <Skeleton className="size-4 rounded-md" data-sidebar="menu-skeleton-icon" />}
594 <Skeleton
595 className="h-4 max-w-(--skeleton-width) flex-1"
596 data-sidebar="menu-skeleton-text"
597 style={
598 {
599 "--skeleton-width": width,
600 } as React.CSSProperties
601 }
602 />
603 </div>
604 );
605}
606
607function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
608 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected