MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / DataView

Function DataView

packages/hosts/mcp-apps-shell/src/shell/shell-app.tsx:761–785  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

759
760 // Not a generative UI result — render a data view
761 const DataView = () => {
762 const text = result.content?.find((c) => c.type === "text")?.text;
763 const isError = (result as { isError?: boolean }).isError;
764 const data = structured as Record<string, unknown> | undefined;
765
766 return (
767 <Components.Card>
768 <Components.CardContent className="pt-4">
769 {isError ? (
770 <Components.Alert variant="destructive">
771 <Components.AlertCircle className="h-4 w-4" />
772 <Components.AlertTitle>Error</Components.AlertTitle>
773 <Components.AlertDescription className="font-mono text-xs whitespace-pre-wrap">
774 {text ?? "Unknown error"}
775 </Components.AlertDescription>
776 </Components.Alert>
777 ) : (
778 <pre className="text-xs font-mono whitespace-pre-wrap overflow-auto max-h-[80vh]">
779 {data ? JSON.stringify(data, null, 2) : (text ?? "(no result)")}
780 </pre>
781 )}
782 </Components.CardContent>
783 </Components.Card>
784 );
785 };
786 setComponent(() => DataView);
787 rendererRef.current = null;
788 openLinkAuthorizationRef.current = null;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected