- {/* Resize Selection */}
-
-
-
-
-
-
-
{/* Recent Activity Settings */}
diff --git a/hooks/useWidgetLayout.ts b/hooks/useWidgetLayout.ts
index b2b0b22..51be753 100644
--- a/hooks/useWidgetLayout.ts
+++ b/hooks/useWidgetLayout.ts
@@ -50,22 +50,21 @@ export interface WidgetConfig {
title: string
visible: boolean
order: number
- colSpan: number // 1, 2, 3, 4 (full)
settings?: Record
}
const DEFAULT_WIDGETS: WidgetConfig[] = [
- { id: "quick-actions", title: "Quick Actions", visible: true, order: 0, colSpan: 4 },
- { id: "overview", title: "Overview", visible: true, order: 1, colSpan: 4, settings: { showChange: false } },
- { id: "recent-activity", title: "Recent Activity", visible: true, order: 2, colSpan: 2, settings: { itemCount: 10 } },
- { id: "top-products", title: "Top Products", visible: true, order: 3, colSpan: 2, settings: { itemCount: 5, showRevenue: true } },
- { id: "revenue-chart", title: "Revenue Chart", visible: false, order: 4, colSpan: 2, settings: { days: 7, showComparison: false } },
- { id: "low-stock", title: "Low Stock Alerts", visible: false, order: 5, colSpan: 2, settings: { threshold: 5, itemCount: 5 } },
- { id: "recent-customers", title: "Recent Customers", visible: false, order: 6, colSpan: 2, settings: { itemCount: 5, showSpent: true } },
- { id: "pending-chats", title: "Pending Chats", visible: false, order: 7, colSpan: 2, settings: { showPreview: true } },
+ { id: "quick-actions", title: "Quick Actions", visible: true, order: 0 },
+ { id: "overview", title: "Overview", visible: true, order: 1, settings: { showChange: false } },
+ { id: "recent-activity", title: "Recent Activity", visible: true, order: 2, settings: { itemCount: 10 } },
+ { id: "top-products", title: "Top Products", visible: true, order: 3, settings: { itemCount: 5, showRevenue: true } },
+ { id: "revenue-chart", title: "Revenue Chart", visible: false, order: 4, settings: { days: 7, showComparison: false } },
+ { id: "low-stock", title: "Low Stock Alerts", visible: false, order: 5, settings: { threshold: 5, itemCount: 5 } },
+ { id: "recent-customers", title: "Recent Customers", visible: false, order: 6, settings: { itemCount: 5, showSpent: true } },
+ { id: "pending-chats", title: "Pending Chats", visible: false, order: 7, settings: { showPreview: true } },
]
-const STORAGE_KEY = "dashboard-widget-layout-v3"
+const STORAGE_KEY = "dashboard-widget-layout-v4"
/**
* useWidgetLayout - Persist and manage dashboard widget visibility, order, and settings
@@ -140,11 +139,6 @@ export function useWidgetLayout() {
)
}, [])
- const updateWidgetColSpan = useCallback((widgetId: string, colSpan: number) => {
- setWidgets(prev =>
- prev.map(w => w.id === widgetId ? { ...w, colSpan } : w)
- )
- }, [])
const getWidgetSettings = useCallback(>(widgetId: string): T | undefined => {
return widgets.find(w => w.id === widgetId)?.settings as T | undefined
@@ -185,7 +179,6 @@ export function useWidgetLayout() {
moveWidget,
reorderWidgets,
updateWidgetSettings,
- updateWidgetColSpan,
getWidgetSettings,
resetLayout,
getVisibleWidgets,