veza/apps/web/src/components/ui/Sidebar.tsx
senke 0a29c544af fix(web): resolve all 568 TypeScript errors — tsc --noEmit now passes with zero errors
Major categories fixed:
- TS6133 (188): Remove unused imports (React, icons, types) and variables
- TS2322 (222): Fix type mismatches in stories (satisfies Meta -> const meta: Meta),
  add nullish coalescing for optional values, fix component prop types
- TS2345 (43): Fix argument type mismatches with proper null checks and type narrowing
- TS2741 (21): Add missing required properties to mock/story data
- TS2339 (19): Fix property access on incorrect types, add type guards
- TS2353 (13): Remove extra properties from object literals or extend interfaces
- TS2352 (11): Fix type conversion chains
- TS2307 (9): Fix import paths and module references
- Other (42): Fix implicit any, possibly undefined, export declarations

Vite build and tsc --noEmit both pass cleanly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 00:32:08 +01:00

41 lines
964 B
TypeScript

import React from 'react';
import { cn } from '@/lib/utils';
export interface SidebarProps {
title?: string;
icon?: React.ReactNode;
position?: 'left' | 'right';
width?: string;
collapsible?: boolean;
children?: React.ReactNode;
className?: string;
}
export const Sidebar: React.FC<SidebarProps> = ({
title,
icon,
position = 'left',
width = '280px',
collapsible: _collapsible = false,
children,
className,
}) => {
return (
<aside
className={cn(
'flex flex-col border-border bg-card h-full shrink-0',
position === 'left' ? 'border-r' : 'border-l',
className,
)}
style={{ width }}
>
{title && (
<div className="flex items-center gap-2 p-4 border-b border-border">
{icon}
<span className="font-semibold text-foreground text-sm">{title}</span>
</div>
)}
<div className="flex-1 overflow-y-auto">{children}</div>
</aside>
);
};