- {/* Header */}
-
+
-
-
{currentArtifact.title}
+
+
+
+
+
+ {localize('com_ui_code')}
+
+
+
+
+
+ {localize('com_ui_preview')}
+
+
+
-
- {/* Refresh button */}
+
+
{activeTab === 'preview' && (
-
+ {isRefreshing ? (
+
+ ) : (
+
+ )}
+
)}
{activeTab !== 'preview' && isMutating && (
)}
- {/* Tabs */}
-
-
- {localize('com_ui_preview')}
-
-
- {localize('com_ui_code')}
-
-
-
+ {orderedArtifactIds.length > 1 && (
+
{
+ const target = orderedArtifactIds[index];
+ if (target) setCurrentArtifactId(target);
+ }}
+ />
+ )}
+
+
+
- {/* Content */}
+
}
previewRef={previewRef as React.MutableRefObject}
/>
- {/* Footer */}
-
-
-
- {`${currentIndex + 1} / ${
- orderedArtifactIds.length
- }`}
-
-
-
-
- {/* Download Button */}
-
- {/* Publish button */}
- {/* */}
-
-
diff --git a/client/src/components/Artifacts/Code.tsx b/client/src/components/Artifacts/Code.tsx
index 4b6d1a0065..c91b0444b1 100644
--- a/client/src/components/Artifacts/Code.tsx
+++ b/client/src/components/Artifacts/Code.tsx
@@ -2,8 +2,9 @@ import React, { memo, useEffect, useRef, useState } from 'react';
import copy from 'copy-to-clipboard';
import rehypeKatex from 'rehype-katex';
import ReactMarkdown from 'react-markdown';
+import { Button } from '@librechat/client';
import rehypeHighlight from 'rehype-highlight';
-import { Clipboard, CheckMark } from '@librechat/client';
+import { Copy, CircleCheckBig } from 'lucide-react';
import { handleDoubleClick, langSubset } from '~/utils';
import { useLocalize } from '~/hooks';
@@ -107,12 +108,13 @@ export const CopyCodeButton: React.FC<{ content: string }> = ({ content }) => {
};
return (
-
+ {isCopied ?
:
}
+
);
};
diff --git a/client/src/components/Artifacts/DownloadArtifact.tsx b/client/src/components/Artifacts/DownloadArtifact.tsx
index afced5a37f..5626cbf44f 100644
--- a/client/src/components/Artifacts/DownloadArtifact.tsx
+++ b/client/src/components/Artifacts/DownloadArtifact.tsx
@@ -1,18 +1,12 @@
import React, { useState } from 'react';
-import { Download } from 'lucide-react';
+import { Download, CircleCheckBig } from 'lucide-react';
import type { Artifact } from '~/common';
-import { CheckMark } from '@librechat/client';
+import { Button } from '@librechat/client';
import useArtifactProps from '~/hooks/Artifacts/useArtifactProps';
import { useEditorContext } from '~/Providers';
import { useLocalize } from '~/hooks';
-const DownloadArtifact = ({
- artifact,
- className = '',
-}: {
- artifact: Artifact;
- className?: string;
-}) => {
+const DownloadArtifact = ({ artifact }: { artifact: Artifact }) => {
const localize = useLocalize();
const { currentCode } = useEditorContext();
const [isDownloaded, setIsDownloaded] = useState(false);
@@ -41,13 +35,14 @@ const DownloadArtifact = ({
};
return (
-
+ {isDownloaded ?
:
}
+
);
};
diff --git a/client/src/hooks/Artifacts/useArtifacts.ts b/client/src/hooks/Artifacts/useArtifacts.ts
index 5eb0d4ee73..e3ef33647d 100644
--- a/client/src/hooks/Artifacts/useArtifacts.ts
+++ b/client/src/hooks/Artifacts/useArtifacts.ts
@@ -129,5 +129,6 @@ export default function useArtifacts() {
cycleArtifact,
currentArtifact,
orderedArtifactIds,
+ setCurrentArtifactId,
};
}
diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json
index b686580376..9e8a228457 100644
--- a/client/src/locales/en/translation.json
+++ b/client/src/locales/en/translation.json
@@ -1263,6 +1263,7 @@
"com_ui_verify": "Verify",
"com_ui_version_var": "Version {{0}}",
"com_ui_versions": "Versions",
+ "com_ui_change_version": "Change Version",
"com_ui_view_memory": "View Memory",
"com_ui_view_source": "View source chat",
"com_ui_web_search": "Web Search",