summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/web/src/components/share/content-code.tsx4
-rw-r--r--packages/web/src/components/share/part.tsx14
2 files changed, 13 insertions, 5 deletions
diff --git a/packages/web/src/components/share/content-code.tsx b/packages/web/src/components/share/content-code.tsx
index b8c4f2ccd..72352d1e9 100644
--- a/packages/web/src/components/share/content-code.tsx
+++ b/packages/web/src/components/share/content-code.tsx
@@ -1,7 +1,7 @@
-import { type JSX, splitProps, createResource, Suspense } from "solid-js"
import { codeToHtml } from "shiki"
-import style from "./content-code.module.css"
+import { createResource, Suspense } from "solid-js"
import { transformerNotationDiff } from "@shikijs/transformers"
+import style from "./content-code.module.css"
interface Props {
code: string
diff --git a/packages/web/src/components/share/part.tsx b/packages/web/src/components/share/part.tsx
index 6f76660a1..4d95fa528 100644
--- a/packages/web/src/components/share/part.tsx
+++ b/packages/web/src/components/share/part.tsx
@@ -28,7 +28,6 @@ import {
IconDocumentMagnifyingGlass,
} from "../icons"
import { IconMeta, IconOpenAI, IconGemini, IconAnthropic } from "../icons/custom"
-import CodeBlock from "../CodeBlock"
import { ContentCode } from "./content-code"
import { ContentDiff } from "./content-diff"
import { ContentText } from "./content-text"
@@ -133,7 +132,8 @@ export function Part(props: PartProps) {
<div data-component="content">
{props.message.role === "user" && props.part.type === "text" && (
<>
- <ContentText text={props.part.text} expand={props.last} /> <Spacer />
+ <ContentText text={props.part.text} expand={props.last} />
+ <Spacer />
</>
)}
{props.message.role === "assistant" && props.part.type === "text" && (
@@ -166,6 +166,14 @@ export function Part(props: PartProps) {
</div>
)}
{props.part.type === "tool" &&
+ props.part.state.status === "error" && (
+ <div data-component="tool">
+ <ContentError>
+ {formatErrorString(props.part.state.error)}
+ </ContentError>
+ </div>
+ )}
+ {props.part.type === "tool" &&
props.part.state.status === "completed" &&
props.message.role === "assistant" && (
<div data-component="tool" data-tool={props.part.tool}>
@@ -453,7 +461,7 @@ export function WebFetchTool(props: ToolProps) {
</Match>
<Match when={props.state.output}>
<ResultsButton>
- <CodeBlock lang={props.state.input.format || "text"} code={props.state.output} />
+ <ContentCode lang={props.state.input.format || "text"} code={props.state.output} />
</ResultsButton>
</Match>
</Switch>