MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / SidebarMenuSkeleton

Function SidebarMenuSkeleton

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

Source from the content-addressed store, hash-verified

600}
601
602function SidebarMenuSkeleton({
603 className,
604 showIcon = false,
605 ...props
606}: React.ComponentProps<"div"> & {
607 showIcon?: boolean
608}) {
609 // Random width between 50 to 90%.
610 const width = React.useMemo(() => {
611 return `${Math.floor(Math.random() * 40) + 50}%`
612 }, [])
613
614 return (
615 <div
616 data-slot="sidebar-menu-skeleton"
617 data-sidebar="menu-skeleton"
618 className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
619 {...props}
620 >
621 {showIcon && (
622 <Skeleton
623 className="size-4 rounded-md"
624 data-sidebar="menu-skeleton-icon"
625 />
626 )}
627 <Skeleton
628 className="h-4 max-w-(--skeleton-width) flex-1"
629 data-sidebar="menu-skeleton-text"
630 style={
631 {
632 "--skeleton-width": width,
633 } as React.CSSProperties
634 }
635 />
636 </div>
637 )
638}
639
640function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
641 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected