fix: change wrong component in json display (#5026)
refactor: Remove wrong CodeBlock import and replace with SimplifiedCodeTabComponent
This commit is contained in:
parent
e14c35ceb5
commit
fbbe887aa8
1 changed files with 12 additions and 10 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import { CodeBlock } from "@/modals/IOModal/components/chatView/chatMessage/codeBlock";
|
|
||||||
import { ContentType } from "@/types/chat";
|
import { ContentType } from "@/types/chat";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
import Markdown from "react-markdown";
|
import Markdown from "react-markdown";
|
||||||
|
|
@ -120,9 +119,9 @@ export default function ContentDisplay({
|
||||||
case "json":
|
case "json":
|
||||||
contentData = (
|
contentData = (
|
||||||
<div className="pr-20">
|
<div className="pr-20">
|
||||||
<CodeBlock
|
<SimplifiedCodeTabComponent
|
||||||
language="json"
|
language="json"
|
||||||
value={JSON.stringify(content.data, null, 2)}
|
code={JSON.stringify(content.data, null, 2)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -134,7 +133,10 @@ export default function ContentDisplay({
|
||||||
{content.reason && <div>Reason: {content.reason}</div>}
|
{content.reason && <div>Reason: {content.reason}</div>}
|
||||||
{content.solution && <div>Solution: {content.solution}</div>}
|
{content.solution && <div>Solution: {content.solution}</div>}
|
||||||
{content.traceback && (
|
{content.traceback && (
|
||||||
<CodeBlock language="text" value={content.traceback} />
|
<SimplifiedCodeTabComponent
|
||||||
|
language="text"
|
||||||
|
code={content.traceback}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -184,9 +186,9 @@ export default function ContentDisplay({
|
||||||
// For objects/arrays, format as JSON
|
// For objects/arrays, format as JSON
|
||||||
try {
|
try {
|
||||||
return (
|
return (
|
||||||
<CodeBlock
|
<SimplifiedCodeTabComponent
|
||||||
language="json"
|
language="json"
|
||||||
value={JSON.stringify(output, null, 2)}
|
code={JSON.stringify(output, null, 2)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} catch {
|
} catch {
|
||||||
|
|
@ -203,9 +205,9 @@ export default function ContentDisplay({
|
||||||
>
|
>
|
||||||
{`${content.name ? `**Tool:** ${content.name}\n\n` : ""}**Input:**`}
|
{`${content.name ? `**Tool:** ${content.name}\n\n` : ""}**Input:**`}
|
||||||
</Markdown>
|
</Markdown>
|
||||||
<CodeBlock
|
<SimplifiedCodeTabComponent
|
||||||
language="json"
|
language="json"
|
||||||
value={JSON.stringify(content.tool_input, null, 2)}
|
code={JSON.stringify(content.tool_input, null, 2)}
|
||||||
/>
|
/>
|
||||||
{content.output !== undefined && (
|
{content.output !== undefined && (
|
||||||
<>
|
<>
|
||||||
|
|
@ -228,9 +230,9 @@ export default function ContentDisplay({
|
||||||
>
|
>
|
||||||
**Error:**
|
**Error:**
|
||||||
</Markdown>
|
</Markdown>
|
||||||
<CodeBlock
|
<SimplifiedCodeTabComponent
|
||||||
language="json"
|
language="json"
|
||||||
value={JSON.stringify(content.error, null, 2)}
|
code={JSON.stringify(content.error, null, 2)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue