mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
feat: restore the alert feed homepage widget
This commit is contained in:
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>
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user