From e9aca179d79f1ceb0f0db6257ecf0375281bf40c Mon Sep 17 00:00:00 2001 From: mptyl Date: Sun, 28 Jun 2026 12:22:37 +0200 Subject: [PATCH] feat(frontend): widget registry + universal fallback --- frontend/src/widgets/FallbackWidget.tsx | 14 ++++++++++++++ frontend/src/widgets/registry.test.tsx | 15 +++++++++++++++ frontend/src/widgets/registry.ts | 13 +++++++++++++ frontend/src/widgets/types.ts | 3 +++ 4 files changed, 45 insertions(+) create mode 100644 frontend/src/widgets/FallbackWidget.tsx create mode 100644 frontend/src/widgets/registry.test.tsx create mode 100644 frontend/src/widgets/registry.ts create mode 100644 frontend/src/widgets/types.ts diff --git a/frontend/src/widgets/FallbackWidget.tsx b/frontend/src/widgets/FallbackWidget.tsx new file mode 100644 index 00000000..bc937334 --- /dev/null +++ b/frontend/src/widgets/FallbackWidget.tsx @@ -0,0 +1,14 @@ +import { useState } from "react"; +import type { WidgetProps } from "./types"; + +export function FallbackWidget({ descriptor, onRespond }: WidgetProps) { + const [text, setText] = useState(""); + return ( +
+

Widget non supportato (kind: {descriptor.widget}) — rispondi manualmente

+
{JSON.stringify(descriptor, null, 2)}
+