1import { forwardRef, useState } from "react";2import { cn } from "../lib/cn";34// Sidebar component — collapsible navigation panel5export const Sidebar = forwardRef<6 HTMLDivElement,7 SidebarProps8>(({ className, side, collapsible, width, ...props }, ref) => {9 const [collapsed, setCollapsed] = useState(false);10 const sidebarWidth = width ?? 240;1112 // TODO: handle keyboard shortcut for collapse toggle13 const handleToggle = () => setCollapsed((prev) => !prev);1415 return (16 <div17 ref={ref}18 data-side={side}19 data-collapsed={collapsed}20 className={cn(21 "flex h-full flex-col bg-sidebar-background",22 className23 )}24 style={{ width: collapsed ? 48 : sidebarWidth }}25 {...props}26 />27 );28});2930Sidebar.displayName = "Sidebar";
12
>pnpm build$ tsc --noEmit && tsup src/index.tssrc/components/sidebar.tsx(20,7): error TS2345:Argument of type 'string | undefined' is not assignableto parameter of type 'string'.Found 1 error in src/components/sidebar.tsx:20>
main12
Ln 9, Col 42Spaces: 2UTF-8TypeScript ReactPrettier