Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(artifact-card): handle missing artifact data gracefully

Steven Enamakel645f1c912d23
diff --git a/app/src/components/assistant-ui/elements/artifact-card.tsx b/app/src/components/assistant-ui/elements/artifact-card.tsx
index 5114bf97db..de1a61b53b 100644
--- a/app/src/components/assistant-ui/elements/artifact-card.tsx
+++ b/app/src/components/assistant-ui/elements/artifact-card.tsx
@@ -102,6 +102,11 @@ function ArtifactCardBody({
writingLabel: string;
Icon: ElementType;
}) {
+ const { t } = useT();
+ const wordsText = t(
+ words === 1 ? 'elements.artifactCard.wordsOne' : 'elements.artifactCard.wordsOther',
+ words === 1 ? '{count} word' : '{count} words'
+ ).replace('{count}', String(words));
return (
<>
<span className="bg-foreground/[0.05] text-foreground/45 flex size-9 shrink-0 items-center justify-center rounded-xl">
@@ -115,7 +120,7 @@ function ArtifactCardBody({
{writingLabel}
</ShimmerLabel>
<span>·</span>
- <span className="tabular-nums">{words} words</span>
+ <span className="tabular-nums">{wordsText}</span>
</p>
) : (
<p