Dark editor card with three traffic-light dots, a filename tab, and line-numbered code.
export function greet(name: string) {return `Hello, ${name}!`;}console.log(greet("Beste"));
Requires shadcn/ui initialized. Run npx shadcn@latest init if you haven't.
import { Code2 } from "@/components/beste/piece/code2";
<Code2
title="greet.ts"
lines={[
"export function greet(name: string) {",
" return `Hello, ${name}!`;",
"}",
"",
"console.log(greet(\"Beste\"));"
]}
/>