MCPcopy Index your code
hub / github.com/midrender/revideo / SourceCodeFrame

Function SourceCodeFrame

packages/ui/src/components/console/SourceCodeFrame.tsx:13–42  ·  view source on GitHub ↗
({entry}: SourceFrameProps)

Source from the content-addressed store, hash-verified

11}
12
13export function SourceCodeFrame({entry}: SourceFrameProps) {
14 const frame = useMemo(
15 () => (entry ? getSourceCodeFrame(entry) : null),
16 [entry],
17 );
18
19 return (
20 <div className={styles.sourceCode}>
21 <pre>
22 <code
23 className="language-ts"
24 dangerouslySetInnerHTML={{
25 __html: frame ?? 'Could not load the source code.',
26 }}
27 />
28 </pre>
29 <IconButton
30 title="Go to source"
31 className={styles.viewSource}
32 onClick={async () => {
33 if (entry) {
34 await openFileInEditor(entry);
35 }
36 }}
37 >
38 <OpenInNew />
39 </IconButton>
40 </div>
41 );
42}

Callers

nothing calls this directly

Calls 2

getSourceCodeFrameFunction · 0.90
openFileInEditorFunction · 0.90

Tested by

no test coverage detected