MCPcopy Create free account
hub / github.com/arctic-cli/interface / SidebarMenuSkeleton

Function SidebarMenuSkeleton

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

Source from the content-addressed store, hash-verified

564const getRandomWidth = () => `${Math.floor(Math.random() * 40) + 50}%`
565
566function SidebarMenuSkeleton({
567 className,
568 showIcon = false,
569 ...props
570}: React.ComponentProps<"div"> & {
571 showIcon?: boolean
572}) {
573 const [width] = React.useState(getRandomWidth)
574
575 return (
576 <div
577 className={cn("flex h-8 items-center gap-2 rounded-lg px-2", className)}
578 data-sidebar="menu-skeleton"
579 data-slot="sidebar-menu-skeleton"
580 {...props}
581 >
582 {showIcon && <Skeleton className="size-4 rounded-lg" data-sidebar="menu-skeleton-icon" />}
583 <Skeleton
584 className="h-4 max-w-(--skeleton-width) flex-1"
585 data-sidebar="menu-skeleton-text"
586 style={
587 {
588 "--skeleton-width": width,
589 } as React.CSSProperties
590 }
591 />
592 </div>
593 )
594}
595
596function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
597 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected