All files / web/src/components/side-bar app-sidebar.tsx

28.57% Statements 8/28
100% Branches 0/0
0% Functions 0/1
28.57% Lines 8/28

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 35 36 37 38 39 40 41    1x 1x 1x 1x 1x           1x 1x     1x                                                
'use client';
 
import { Link } from '@tanstack/react-router';
import { AnimatedLogo } from '@web/components/side-bar/animated-logo';
import { NavMain } from '@web/components/side-bar/nav-main';
import { NavUser } from '@web/components/side-bar/nav-user';
import {
  Sidebar,
  SidebarContent,
  SidebarHeader,
  SidebarRail,
} from '@web/components/ui/sidebar';
import { SideBarData } from '@web/constants';
import { useSidebar } from '@web/providers/side-bar';
import type * as React from 'react';
 
export function AppSidebar({
  ...props
}: React.ComponentProps<typeof Sidebar>): React.ReactElement {
  const { state } = useSidebar();
  const isCollapsed = state === 'collapsed';
 
  return (
    <Sidebar collapsible="icon" {...props}>
      <SidebarHeader className="p-2 flex items-center justify-center group-data-[collapsible=icon]:p-0 transition-all">
        <Link
          to="/"
          className="flex h-14 items-center justify-center relative rounded-sm w-full group-data-[collapsible=icon]:w-10 group-data-[collapsible=icon]:h-10 group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:m-2"
        >
          <AnimatedLogo isCollapsed={isCollapsed} />
        </Link>
      </SidebarHeader>
      <SidebarContent>
        <NavMain sections={SideBarData.sections} />
      </SidebarContent>
      <NavUser />
      <SidebarRail />
    </Sidebar>
  );
}