// import React from 'react'; // const CodeEditor = () => { // const copyCode = () => { // const codeElement = document.getElementById('code-snippet'); // navigator.clipboard.writeText(codeElement.innerText) // .then(() => { // alert('Code copied to clipboard!'); // }) // .catch(err => { // console.error('Failed to copy: ', err); // }); // }; // return ( //
//
//         
//           {`class Painter:
//     def color_shape(self, shape):
//         # Code for coloring the shape
//         pass`}
//         
//       
// //
// ); // }; // export default CodeEditor; // src/components/CodeBlock.js import React from 'react'; const CodeBlock = ({ code }) => { const copyCode = () => { navigator.clipboard.writeText(code) .then(() => { alert('Code copied to clipboard!'); }) .catch(err => { console.error('Failed to copy: ', err); }); }; return (
        {code}
      
); }; export default CodeBlock;