LibreChat/src/components/Messages/Embed.jsx

22 lines
688 B
React
Raw Normal View History

2023-03-03 08:51:33 -05:00
import React from 'react';
2023-03-02 16:31:00 -05:00
import Clipboard from '../svg/Clipboard';
2023-02-23 16:32:08 -05:00
export default function Embed({ children, language = '', matched}) {
2023-02-23 16:32:08 -05:00
return (
<pre>
<div className="mb-4 rounded-md bg-black">
<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>
2023-02-23 16:32:08 -05:00
<button className="ml-auto flex gap-2">
2023-03-02 16:31:00 -05:00
<Clipboard />
2023-02-23 16:32:08 -05:00
Copy code
</button>
</div>
<div className="overflow-y-auto p-4">
{ children }
</div>
</div>
</pre>
);
}