diff --git a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx index d6b0ab07..0e6763b6 100644 --- a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx +++ b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx @@ -14,6 +14,7 @@ import { useState, type CSSProperties, type ComponentProps, + type ComponentPropsWithoutRef, type HTMLAttributes, } from "react"; import { toast } from "sonner"; @@ -40,6 +41,7 @@ import { CodeEditor } from "@/components/workspace/code-editor"; import { useArtifactContent } from "@/core/artifacts/hooks"; import { resolveArtifactURL, urlOfArtifact } from "@/core/artifacts/utils"; import { useI18n } from "@/core/i18n/hooks"; +import { MarkdownTable } from "@/components/workspace/messages/markdown-content"; import { streamdownPlugins } from "@/core/streamdown"; import { checkCodeFile, getFileName } from "@/core/utils/files"; import { useMarkdownDownload } from "@/core/utils/markdown-download"; @@ -909,11 +911,26 @@ export function ArtifactFilePreview({ threadId: string; filepath?: string; }) { + const { t } = useI18n(); const zoomScale = zoom / 100; const normalizedContent = useMemo(() => { return rewriteArtifactImagePaths(content ?? "", threadId, filepath); }, [content, threadId, filepath]); + const streamdownComponents = useMemo( + () => ({ + a: CitationLink, + table: (props: ComponentPropsWithoutRef<"table">) => ( + + ), + }), + [t.clipboard.copyToClipboard, t.common.download], + ); + if (language === "markdown") { return (
{normalizedContent}