| 631 | } |
| 632 | |
| 633 | function SidebarMenuSubButton({ |
| 634 | asChild = false, |
| 635 | size = "md", |
| 636 | isActive = false, |
| 637 | className, |
| 638 | ...props |
| 639 | }: React.ComponentProps<"a"> & { |
| 640 | asChild?: boolean; |
| 641 | size?: "sm" | "md"; |
| 642 | isActive?: boolean; |
| 643 | }) { |
| 644 | const Comp = asChild ? Slot.Root : "a"; |
| 645 | |
| 646 | return ( |
| 647 | <Comp |
| 648 | data-slot="sidebar-menu-sub-button" |
| 649 | data-sidebar="menu-sub-button" |
| 650 | data-size={size} |
| 651 | data-active={isActive} |
| 652 | className={cn( |
| 653 | "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", |
| 654 | "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", |
| 655 | size === "sm" && "text-xs", |
| 656 | size === "md" && "text-sm", |
| 657 | "group-data-[collapsible=icon]:hidden", |
| 658 | className, |
| 659 | )} |
| 660 | {...props} |
| 661 | /> |
| 662 | ); |
| 663 | } |
| 664 | |
| 665 | export { |
| 666 | Sidebar, |