import type { ReactNode } from 'react'; import { Card, CardContent, CardHeader, CardTitle, CardAction } from '@hm-design/ui'; import { Button } from '@hm-design/ui'; import { ChevronDown, ChevronRight, X } from 'lucide-react'; import { useDraggablePanel } from '../hooks/useDraggablePanel'; export interface DraggablePanelProps { title: string; icon?: ReactNode; initial: { left: number; top: number }; width?: number; height?: number; open: boolean; onClose: () => void; headerActions?: ReactNode; children: ReactNode; } export function DraggablePanel({ title, icon, initial, width = 320, height = 420, open, onClose, headerActions, children, }: DraggablePanelProps) { const { panelRef, style, collapsed, toggleCollapse, headerProps } = useDraggablePanel(initial); if (!open) return null; return ( {icon} {title} {headerActions} {!collapsed && ( {children} )} ); }