import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { GripVertical, ChevronDown, ChevronRight, Trash2 } from 'lucide-react'; import { cn } from '../../utils/cn'; export interface PreviewModelEntry { _uid: string; model: string; id: string; index: number; baseUrl: string; apiKey: string; displayName: string; noImageSupport: boolean; provider: string; isAg: boolean; [key: string]: unknown; } export function SortableModelItem({ entry, collapsed, onToggle, onRemove }: { entry: PreviewModelEntry; collapsed: boolean; onToggle: () => void; onRemove?: () => void; }) { const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: entry._uid }); const style = { transform: CSS.Translate.toString(transform), transition: isDragging ? 'none' : transition, }; return (
{JSON.stringify((() => { const { _uid, isAg, ...rest } = entry; return rest; })(), null, 2)}