gitscope
← marzneshin / v0.7.3 / dashboard/src/common/components/sidebar/sidebar-group.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/common/components/sidebar/sidebar-group.tsx · TypeScript
Blame Raw
 1
 2import { FC, PropsWithChildren } from "react"
 3import { Label } from "@marzneshin/common/components"
 4import { cn } from "@marzneshin/common/utils"
 5import { useSidebarContext } from "./sidebar-provider";
 6
 7export interface SidebarGroupProps
 8    extends PropsWithChildren {
 9    className: string
10}
11
12export const SidebarGroup: FC<SidebarGroupProps> = ({ children, className }) => {
13    const { collapsed } = useSidebarContext();
14
15    if (!collapsed)
16        return (
17            <Label className={cn(className, "text-gray-500 font-header")}>
18                {children}
19            </Label>
20        )
21}