MCPcopy Create free account
hub / github.com/freecodexyz/free-code / MessageResponse

Function MessageResponse

src/components/MessageResponse.tsx:10–57  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

8 height?: number;
9};
10export function MessageResponse(t0) {
11 const $ = _c(8);
12 const {
13 children,
14 height
15 } = t0;
16 const isMessageResponse = useContext(MessageResponseContext);
17 if (isMessageResponse) {
18 return children;
19 }
20 let t1;
21 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22 t1 = <NoSelect fromLeftEdge={true} flexShrink={0}><Text dimColor={true}>{" "}⎿  </Text></NoSelect>;
23 $[0] = t1;
24 } else {
25 t1 = $[0];
26 }
27 let t2;
28 if ($[1] !== children) {
29 t2 = <Box flexShrink={1} flexGrow={1}>{children}</Box>;
30 $[1] = children;
31 $[2] = t2;
32 } else {
33 t2 = $[2];
34 }
35 let t3;
36 if ($[3] !== height || $[4] !== t2) {
37 t3 = <MessageResponseProvider><Box flexDirection="row" height={height} overflowY="hidden">{t1}{t2}</Box></MessageResponseProvider>;
38 $[3] = height;
39 $[4] = t2;
40 $[5] = t3;
41 } else {
42 t3 = $[5];
43 }
44 const content = t3;
45 if (height !== undefined) {
46 return content;
47 }
48 let t4;
49 if ($[6] !== content) {
50 t4 = <Ratchet lock="offscreen">{content}</Ratchet>;
51 $[6] = content;
52 $[7] = t4;
53 } else {
54 t4 = $[7];
55 }
56 return t4;
57}
58
59// This is a context that is used to determine if the message response
60// is rendered as a descendant of another MessageResponse. We use it

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected