| 667 | } |
| 668 | |
| 669 | function SidebarMenuSubButton({ |
| 670 | asChild = false, |
| 671 | size = "md", |
| 672 | isActive = false, |
| 673 | className, |
| 674 | ...props |
| 675 | }: React.ComponentProps<"a"> & { |
| 676 | asChild?: boolean |
| 677 | size?: "sm" | "md" |
| 678 | isActive?: boolean |
| 679 | }) { |
| 680 | const Comp = asChild ? Slot : "a" |
| 681 | |
| 682 | return ( |
| 683 | <Comp |
| 684 | data-slot="sidebar-menu-sub-button" |
| 685 | data-sidebar="menu-sub-button" |
| 686 | data-size={size} |
| 687 | data-active={isActive} |
| 688 | className={cn( |
| 689 | "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 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", |
| 690 | "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", |
| 691 | size === "sm" && "text-xs", |
| 692 | size === "md" && "text-sm", |
| 693 | "group-data-[collapsible=icon]:hidden", |
| 694 | className |
| 695 | )} |
| 696 | {...props} |
| 697 | /> |
| 698 | ) |
| 699 | } |
| 700 | |
| 701 | export { |
| 702 | Sidebar, |