import { FC, useState } from "react"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { tomorrow } from "react-syntax-highlighter/dist/cjs/styles/prism"; interface Props { language: string; value: string; } export const CodeBlock: FC = ({ language, value }) => { const [buttonText, setButtonText] = useState("Copy"); const copyToClipboard = () => { navigator.clipboard.writeText(value).then(() => { setButtonText("Copied!"); setTimeout(() => { setButtonText("Copy"); }, 2000); }); }; return (
{value}
); };