mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 12:16:53 +00:00
Update CopyableCode.tsx
This commit is contained in:
parent
ca88e13d13
commit
8bf675450a
@ -26,16 +26,19 @@ const CopyableCode: React.FC<CopyableCodeProps> = ({ code, language, className }
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("relative w-full", className)}>
|
<div className={cn("relative w-full", className)}>
|
||||||
<pre
|
<div className="w-full overflow-x-auto">
|
||||||
className={cn(
|
<pre
|
||||||
"bg-gray-100 p-2 sm:p-3 md:p-4 rounded-md overflow-x-auto",
|
className={cn(
|
||||||
"text-xs sm:text-sm md:text-base",
|
"w-full min-w-0 bg-gray-100 p-2 sm:p-3 md:p-4 rounded-md overflow-x-auto",
|
||||||
"max-w-full",
|
"text-xs sm:text-sm md:text-base",
|
||||||
language ? `language-${language}` : "",
|
"max-w-full",
|
||||||
)}
|
language ? `language-${language}` : "",
|
||||||
>
|
)}
|
||||||
<code className="whitespace-pre">{decodeURIComponent(code)}</code>
|
>
|
||||||
</pre>
|
<code className="whitespace-pre">{decodeURIComponent(code)}</code>
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={copyToClipboard}
|
onClick={copyToClipboard}
|
||||||
className="absolute top-1 right-1 sm:top-2 sm:right-2 p-1 sm:p-2 bg-white rounded-md shadow-sm hover:bg-gray-100 transition-colors"
|
className="absolute top-1 right-1 sm:top-2 sm:right-2 p-1 sm:p-2 bg-white rounded-md shadow-sm hover:bg-gray-100 transition-colors"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user