Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

copy code in progress

Danny Avila50ff96cbc547
diff --git a/app/detectCode.js b/app/detectCode.js
index db286cbdaf..0ef6af31fc 100644
--- a/app/detectCode.js
+++ b/app/detectCode.js
@@ -25,7 +25,8 @@ const detectCode = async (text) => {
const language = await modelOperations.runModel(code);
return part.replace(/^```/, `\`\`\`${language[0].languageId}`);
} else {
- return i > 0 ? '\n' + part : part;
+ // return i > 0 ? '\n' + part : part;
+ return part;
}
});
diff --git a/src/components/Messages/Embed.jsx b/src/components/Messages/Embed.jsx
index c69eba3164..0cb65ebd08 100644
--- a/src/components/Messages/Embed.jsx
+++ b/src/components/Messages/Embed.jsx
@@ -1,4 +1,5 @@
-import React from 'react';
+import React, { useState } from 'react';
+import Clipboard from '../svg/Clipboard';
export default function Embed({ children, language = '', matched}) {
return (
@@ -7,28 +8,7 @@ export default function Embed({ children, language = '', matched}) {
<div className="relative flex items-center bg-gray-800 px-4 py-2 font-sans text-xs text-gray-200 rounded-tl-md rounded-tr-md">
<span className="">{ (language === 'javascript' && !matched ? '' : language) }</span>
<button className="ml-auto flex gap-2">
- <svg
- stroke="currentColor"
- fill="none"
- strokeWidth="2"
- viewBox="0 0 24 24"
- strokeLinecap="round"
- strokeLinejoin="round"
- className="h-4 w-4"
- height="1em"
- width="1em"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path>
- <rect
- x="8"
- y="2"
- width="8"
- height="4"
- rx="1"
- ry="1"
- ></rect>
- </svg>
+ <Clipboard />
Copy code
</button>
</div>
diff --git a/src/components/svg/Clipboard.jsx b/src/components/svg/Clipboard.jsx
new file mode 100644
index 0000000000..51ba28d5b0
--- /dev/null
+++ b/src/components/svg/Clipboard.jsx
@@ -0,0 +1,28 @@
+import React from 'react';
+
+export default function Clipboard() {
+ return (
+ <svg
+ stroke="currentColor"
+ fill="none"
+ strokeWidth="2"
+ viewBox="0 0 24 24"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ className="h-4 w-4"
+ height="1em"
+ width="1em"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path>
+ <rect
+ x="8"
+ y="2"
+ width="8"
+ height="4"
+ rx="1"
+ ry="1"
+ />
+ </svg>
+ );
+}