MCPcopy
hub / github.com/code-hike/codehike / CodeWithNotes

Function CodeWithNotes

apps/web/components/code/blocks-demo.tsx:52–74  ·  view source on GitHub ↗
({
  code,
  notes = {},
}: {
  code: RawCode
  notes?: Record<string, { children: React.ReactNode }>
})

Source from the content-addressed store, hash-verified

50}
51
52export async function CodeWithNotes({
53 code,
54 notes = {},
55}: {
56 code: RawCode
57 notes?: Record<string, { children: React.ReactNode }>
58}) {
59 const highlighted = await highlight(code, theme)
60
61 highlighted.annotations = highlighted.annotations.map((a) => {
62 const note = notes[a.query]
63 if (!note) return a
64 return {
65 ...a,
66 data: {
67 ...a.data,
68 children: note.children,
69 },
70 }
71 })
72
73 return <HighCode className="min-h-full" highlighted={highlighted} />
74}
75
76async function CalloutCode({ code }: { code: RawCode }) {
77 const highlighted = await highlight(code, theme)

Callers

nothing calls this directly

Calls 1

highlightFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…