From 2bbb8e6a3a5e3ccbd18ee27447815768c23175ed Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 13 Feb 2026 13:35:33 +0200 Subject: [PATCH] Add InfoCard for not_found status with amber warning styling --- .../components/tool-ui/update-notion-page.tsx | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/surfsense_web/components/tool-ui/update-notion-page.tsx b/surfsense_web/components/tool-ui/update-notion-page.tsx index 405b1177d..01fe5308f 100644 --- a/surfsense_web/components/tool-ui/update-notion-page.tsx +++ b/surfsense_web/components/tool-ui/update-notion-page.tsx @@ -4,6 +4,7 @@ import { makeAssistantToolUI } from "@assistant-ui/react"; import { AlertTriangleIcon, CheckIcon, + InfoIcon, Loader2Icon, MaximizeIcon, MinimizeIcon, @@ -59,7 +60,12 @@ interface ErrorResult { message: string; } -type UpdateNotionPageResult = InterruptResult | SuccessResult | ErrorResult; +interface InfoResult { + status: "not_found"; + message: string; +} + +type UpdateNotionPageResult = InterruptResult | SuccessResult | ErrorResult | InfoResult; function isInterruptResult(result: unknown): result is InterruptResult { return ( @@ -79,6 +85,15 @@ function isErrorResult(result: unknown): result is ErrorResult { ); } +function isInfoResult(result: unknown): result is InfoResult { + return ( + typeof result === "object" && + result !== null && + "status" in result && + (result as InfoResult).status === "not_found" + ); +} + function ApprovalCard({ args, interruptData, @@ -349,6 +364,21 @@ function ErrorCard({ result }: { result: ErrorResult }) { ); } +function InfoCard({ result }: { result: InfoResult }) { + return ( +
+
+
+ +
+
+

{result.message}

+
+
+
+ ); +} + function SuccessCard({ result }: { result: SuccessResult }) { return (
@@ -446,6 +476,10 @@ export const UpdateNotionPageToolUI = makeAssistantToolUI< return null; } + if (isInfoResult(result)) { + return ; + } + if (isErrorResult(result)) { return ; }