MCPcopy Index your code
hub / github.com/intentui/intentui / fetchContents

Function fetchContents

src/components/code/code-block.tsx:35–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 }
34 useEffect(() => {
35 const fetchContents = async () => {
36 const loadedContents: Record<string, string> = {}
37 for (const [name, path] of Object.entries(source)) {
38 try {
39 const response = await fetch(`/stubs/${path}.json`)
40 const data = await response.json()
41 loadedContents[name] = data.files[0].content
42 } catch (error) {
43 console.error(`Error fetching ${path}:`, error)
44 }
45 }
46 setContents(loadedContents)
47 }
48
49 fetchContents()
50 }, [source])

Callers 1

CodeBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected