'use client' import { WIDGET_REGISTRY } from '@/lib/widgets/registry' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { HugeiconsIcon } from '@hugeicons/react' import { Cancel01Icon, DragDropVerticalIcon } from '@hugeicons/core-free-icons' import { cn } from '@/lib/utils' interface WidgetContainerProps { widgetType: string editMode: boolean onRemove: () => void } export function WidgetContainer({ widgetType, editMode, onRemove }: WidgetContainerProps) { const def = WIDGET_REGISTRY[widgetType] const Component = def?.component return (
{editMode && ( )} {def?.label ?? widgetType}
{editMode && ( )}
{Component ? ( ) : (

Unknown widget type: {widgetType}

)}
) }