components
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export const CodeBlock = ({ code }: { code: string }) => (
|
||||
<div className="position-relative">
|
||||
<pre className="bg-dark text-white p-3 rounded overflow-auto mb-0">
|
||||
<code>{code}</code>
|
||||
</pre>
|
||||
<button
|
||||
className="btn btn-sm btn-light position-absolute top-0 end-0 m-2"
|
||||
onClick={() => navigator.clipboard.writeText(code)}
|
||||
>
|
||||
Copiar
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
Reference in New Issue
Block a user