mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-20 22:36:27 +00:00
20 lines
441 B
TypeScript
20 lines
441 B
TypeScript
import { CodeEditor } from "@/registry/default/ui/code-editor"
|
|
|
|
export default function CodeEditorDemo() {
|
|
return (
|
|
<CodeEditor
|
|
defaultValue={`function fibonacci(n) {
|
|
if (n <= 1) return n
|
|
|
|
return fibonacci(n - 1) + fibonacci(n - 2)
|
|
}
|
|
|
|
// Calculate the 10th Fibonacci number
|
|
const result = fibonacci(10)
|
|
console.log(\`The 10th Fibonacci number is: \${result}\`)`}
|
|
language="javascript"
|
|
height="300px"
|
|
/>
|
|
)
|
|
}
|