import React from 'react'; // import '~/atom-one-dark.css'; export default function Embed({ children, language = ''}) { return (
{ language }
{ children }
{/* export default function CodeWrapper({ text }) {
const matchRegex = /(`[^`]+?`)/g; // regex to match backticks and text between them
const parts = text.split(matchRegex);
console.log('parts', parts);
// map over the parts and wrap any backticked text with <code> tags
const codeParts = parts.map((part, index) => {
if (part.match(matchRegex)) {
<>
return <code key={index}>{part}</code>;
>
} else {
<>
return part.trim(); // remove leading/trailing whitespace from non-backticked text
>
}
});
return <>{codeParts}</>; // return the wrapped text
} */}
);
}