Spaces:
Running
Running
File size: 541 Bytes
9a8e271 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import { CodePanel } from '../CodePanel';
export default function CodePanelExample() {
const sampleCode = `function reverseString(str) {
return str.split('').reverse().join('');
}
// Example usage
const original = "Hello, World!";
const reversed = reverseString(original);
console.log(reversed); // !dlroW ,olleH`;
return (
<div className="h-[600px]">
<CodePanel
fileName="example.js"
language="JavaScript"
code={sampleCode}
onRun={() => console.log('Run code')}
/>
</div>
);
}
|