MCPcopy Create free account
hub / github.com/amaancoderx/skillui / CodeLines

Function CodeLines

components/CodeBlock.tsx:50–76  ·  view source on GitHub ↗
({ code }: { code: string })

Source from the content-addressed store, hash-verified

48}
49
50function CodeLines({ code }: { code: string }) {
51 return (
52 <>
53 {code.split('\n').map((line, i) => {
54 const isComment = line.trim().startsWith('#')
55 const isPrompt = line.trim().startsWith('>')
56 if (line === '') return <span key={i} className="block h-3" />
57 if (isComment) return (
58 <div key={i}>
59 <span className="text-[#999] dark:text-[#555]">{line}</span>
60 </div>
61 )
62 if (isPrompt) return (
63 <div key={i}>
64 <span className="text-[#bbb] dark:text-[#555] select-none">{'> '}</span>
65 <span className="text-[#111] dark:text-[#e8e8e8]">{line.replace(/^>\s*/, '')}</span>
66 </div>
67 )
68 return (
69 <div key={i}>
70 <span className="text-[#111] dark:text-[#e8e8e8]">{line}</span>
71 </div>
72 )
73 })}
74 </>
75 )
76}
77
78function CopyButton({ copied, copy }: { copied: boolean; copy: () => void }) {
79 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected