MCPcopy Create free account
hub / github.com/Noumena-Network/code / row

Function row

src/components/Stats.tsx:1107–1120  ·  view source on GitHub ↗
(l1: string, v1: string, l2: string, v2: string)

Source from the content-addressed store, hash-verified

1105 const COL2_START = 40;
1106 const COL2_LABEL_WIDTH = 18;
1107 const row = (l1: string, v1: string, l2: string, v2: string): string => {
1108 // Build column 1: label + value
1109 const label1 = (l1 + ':').padEnd(COL1_LABEL_WIDTH);
1110 const col1PlainLen = label1.length + v1.length;
1111
1112 // Calculate spaces needed between col1 value and col2 label
1113 const spaceBetween = Math.max(2, COL2_START - col1PlainLen);
1114
1115 // Build column 2: label + value
1116 const label2 = (l2 + ':').padEnd(COL2_LABEL_WIDTH);
1117
1118 // Assemble with colors applied to values only
1119 return label1 + h(v1) + ' '.repeat(spaceBetween) + label2 + h(v2);
1120 };
1121
1122 // Heatmap - use fixed width for screenshot (56 = 52 weeks + 4 for day labels)
1123 if (stats.dailyActivity.length > 0) {

Callers 1

renderOverviewToAnsiFunction · 0.85

Calls 2

hFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected