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

Function UserCommandMessage

src/components/messages/UserCommandMessage.tsx:12–107  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

10 param: TextBlockParam;
11};
12export function UserCommandMessage(t0) {
13 const $ = _c(19);
14 const {
15 addMargin,
16 param: t1
17 } = t0;
18 const {
19 text
20 } = t1;
21 let t2;
22 if ($[0] !== text) {
23 t2 = extractTag(text, COMMAND_MESSAGE_TAG);
24 $[0] = text;
25 $[1] = t2;
26 } else {
27 t2 = $[1];
28 }
29 const commandMessage = t2;
30 let t3;
31 if ($[2] !== text) {
32 t3 = extractTag(text, "command-args");
33 $[2] = text;
34 $[3] = t3;
35 } else {
36 t3 = $[3];
37 }
38 const args = t3;
39 const isSkillFormat = extractTag(text, "skill-format") === "true";
40 if (!commandMessage) {
41 return null;
42 }
43 if (isSkillFormat) {
44 const t4 = addMargin ? 1 : 0;
45 let t5;
46 if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
47 t5 = <Text color="subtle">{figures.pointer} </Text>;
48 $[4] = t5;
49 } else {
50 t5 = $[4];
51 }
52 let t6;
53 if ($[5] !== commandMessage) {
54 t6 = <Text>{t5}<Text color="text">Skill({commandMessage})</Text></Text>;
55 $[5] = commandMessage;
56 $[6] = t6;
57 } else {
58 t6 = $[6];
59 }
60 let t7;
61 if ($[7] !== t4 || $[8] !== t6) {
62 t7 = <Box flexDirection="column" marginTop={t4} backgroundColor="userMessageBackground" paddingRight={1}>{t6}</Box>;
63 $[7] = t4;
64 $[8] = t6;
65 $[9] = t7;
66 } else {
67 t7 = $[9];
68 }
69 return t7;

Callers

nothing calls this directly

Calls 1

extractTagFunction · 0.85

Tested by

no test coverage detected