diff --git a/apps/web/src/components/settings/pages/DashboardWidgetPreview.tsx b/apps/web/src/components/settings/pages/DashboardWidgetPreview.tsx index b7f19a86..5078b13b 100644 --- a/apps/web/src/components/settings/pages/DashboardWidgetPreview.tsx +++ b/apps/web/src/components/settings/pages/DashboardWidgetPreview.tsx @@ -8,7 +8,6 @@ import { DndContext, DragEndEvent, DragOverEvent, - DragOverlay, DragStartEvent, KeyboardSensor, PointerSensor, @@ -958,6 +957,27 @@ export function DashboardWidgetPreview({ return null; }, [activeId, columns, widgetCatalog]); + const renderActiveWidgetPreview = () => { + if (!activeWidget) return null; + + const isLibrary = "key" in activeWidget; + const type = isLibrary ? (activeWidget as WidgetCatalogItem).key : (activeWidget as ColumnWidget).type; + const catalogItem = isLibrary + ? (activeWidget as WidgetCatalogItem) + : widgetCatalog.find((item) => item.key === type); + const params = { + ...(catalogItem?.properties ?? {}), + ...("properties" in activeWidget ? (activeWidget as ColumnWidget).properties : {}), + ...((activeWidget as ColumnWidget).input ?? {}), + }; + + return ( +