# All files / src/components/ui/sidebar-menu SidebarGroupAction.tsx

0% Statements 0/33
0% Branches 0/1
0% Functions 0/1
0% Lines 0/33

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34

     "use client"

    import { ComponentProps } from "react"
    import { cn } from "@/lib/utils"

    export function SidebarGroupAction({
      className,
      asChild = false,
      ...props
    }: ComponentProps<"button"> & { asChild?: boolean }) {
      const Comp = asChild ? "div" : "button"

      return (
        <Comp
          data-slot="sidebar-group-action"
          data-sidebar="group-action"
          className={cn(
            "mat-mdc-button mat-icon-button",
            "absolute top-3.5 right-3",
            "flex items-center justify-center",
            "w-5 h-5 p-0",
            "rounded-md",
            "transition-transform",
            "focus-visible:ring-2 focus-visible:ring-offset-2",
            "hover:bg-gray-200 dark:hover:bg-gray-700",
            "[&>svg]:w-4 [&>svg]:h-4 [&>svg]:shrink-0",
            "group-data-[collapsible=icon]:hidden",
            className
          )}
          {...props}
        />
      )
    }