MCPcopy Create free account
hub / github.com/pomber/code-surfer / CodeSurferContainer

Function CodeSurferContainer

packs/standalone/src/frame.tsx:24–70  ·  view source on GitHub ↗
({
  progress,
  dimensions,
  steps,
  tokens,
  types,
  maxLineCount,
  showNumbers
}: ContainerProps)

Source from the content-addressed store, hash-verified

22};
23
24function CodeSurferContainer({
25 progress,
26 dimensions,
27 steps,
28 tokens,
29 types,
30 maxLineCount,
31 showNumbers
32}: ContainerProps) {
33 const prev = steps[Math.floor(progress)];
34 const next = steps[Math.floor(progress) + 1];
35 const stepPair = React.useMemo(() => new Tuple(prev, next), [prev, next]);
36
37 const titlePair = React.useMemo(() => stepPair.select(step => step.title), [
38 stepPair
39 ]);
40 const subtitlePair = React.useMemo(
41 () => stepPair.select(step => step.subtitle),
42 [stepPair]
43 );
44
45 const t = progress % 1;
46
47 return (
48 <div
49 className="cs-container"
50 style={{
51 width: "100%",
52 height: dimensions ? dimensions.containerHeight : "100%",
53 maxHeight: "100%",
54 position: "relative"
55 }}
56 >
57 <CodeSurferContent
58 dimensions={dimensions}
59 stepPair={stepPair}
60 t={t}
61 tokens={tokens}
62 types={types}
63 maxLineCount={maxLineCount}
64 showNumbers={showNumbers}
65 />
66 <Title textPair={titlePair} t={t} />
67 <Subtitle textPair={subtitlePair} t={t} />
68 </div>
69 );
70}
71
72function CodeSurferContent({
73 dimensions,

Callers

nothing calls this directly

Calls 1

selectMethod · 0.80

Tested by

no test coverage detected