feat: restore the alert feed homepage widget

This commit is contained in:
LukeGus committed 2026-09-30 16:21:22 -05:00
1 parent 0d94ad5e5f
commit e1f2cc975d
11 files changed
+319 -5

No files matched your search

@@ -136,9 +136,19 @@ export function AddWidgetMenu({ state, onAdd, onClose }: AddWidgetMenuProps) {
>
<span className="text-accent-brand shrink-0">{type.icon}</span>
<div className="flex flex-col min-w-0">
<span className="font-medium truncate">{type.name}</span>
<span className="font-medium truncate">
{type.labelComponent ? (
<type.labelComponent part="name" />
) : (
type.name
)}
</span>
<span className="text-[10px] text-muted-foreground truncate">
{type.description}
{type.labelComponent ? (
<type.labelComponent part="description" />
) : (
type.description
)}
</span>
</div>
</button>
+2
View File
@@ -365,6 +365,8 @@ export interface WidgetTypeDefinition<C = Record<string, unknown>> {
minSize: { w: number; h: number };
component: React.ComponentType<WidgetComponentProps<C>>;
editFormComponent?: React.ComponentType<WidgetEditFormProps<C>>;
/** Renders the translated name or description in the add menu. */
labelComponent?: React.ComponentType<{ part: "name" | "description" }>;
}
export interface DragState {
@@ -49,6 +49,7 @@ function toDefinition(
...(rest as unknown as WidgetTypeDefinition),
component: view,
editFormComponent: components?.editForm,
labelComponent: components?.label,
};
}