/**
 * SWI widgets that can be added to the Master Personal Dashboard.
 * IDs should match entries in Master_Dashboard_Frontend personalized widget options when registered.
 */
export const SWI_PERSONAL_DASHBOARD_WIDGETS = [
  {
    id: "swiStatsSummary",
    label: "SWI: Summary stats",
    description: "My SWIs, remaining, completed, and location totals",
    section: "Overview",
  },
  {
    id: "swiLocationChart",
    label: "SWI: Location-wise chart",
    description: "SWI counts grouped by plant location",
    section: "Charts",
  },
  {
    id: "swiUserStatusChart",
    label: "SWI: Your status chart",
    description: "Your assigned SWIs broken down by status",
    section: "Charts",
  },
  {
    id: "swiAssignmentTrend",
    label: "SWI: Assignments over time",
    description: "Monthly, quarterly, half-yearly, and yearly assignment trend",
    section: "Charts",
  },
  {
    id: "swiRemaining",
    label: "SWI: Remaining work",
    description: "Remaining vs completed SWIs with progress bar",
    section: "Tasks",
  },
  {
    id: "swiRecentUndone",
    label: "SWI: Recent undone (5)",
    description: "Latest five SWIs that still need action",
    section: "Tasks",
  },
];

export const SWI_WIDGET_IDS = SWI_PERSONAL_DASHBOARD_WIDGETS.map((w) => w.id);

export function getSwiWidgetMeta(widgetId) {
  return SWI_PERSONAL_DASHBOARD_WIDGETS.find((w) => w.id === widgetId) || null;
}
