| 49 | return maxWidth; |
| 50 | } |
| 51 | export function Feed(t0) { |
| 52 | const $ = _c(15); |
| 53 | const { |
| 54 | config, |
| 55 | actualWidth |
| 56 | } = t0; |
| 57 | const { |
| 58 | title, |
| 59 | lines, |
| 60 | footer, |
| 61 | emptyMessage, |
| 62 | customContent |
| 63 | } = config; |
| 64 | let t1; |
| 65 | if ($[0] !== lines) { |
| 66 | t1 = Math.max(0, ...lines.map(_temp)); |
| 67 | $[0] = lines; |
| 68 | $[1] = t1; |
| 69 | } else { |
| 70 | t1 = $[1]; |
| 71 | } |
| 72 | const maxTimestampWidth = t1; |
| 73 | let t2; |
| 74 | if ($[2] !== title) { |
| 75 | t2 = <Text bold={true} color="claude">{title}</Text>; |
| 76 | $[2] = title; |
| 77 | $[3] = t2; |
| 78 | } else { |
| 79 | t2 = $[3]; |
| 80 | } |
| 81 | let t3; |
| 82 | if ($[4] !== actualWidth || $[5] !== customContent || $[6] !== emptyMessage || $[7] !== footer || $[8] !== lines || $[9] !== maxTimestampWidth) { |
| 83 | t3 = customContent ? <>{customContent.content}{footer && <Text dimColor={true} italic={true}>{truncate(footer, actualWidth)}</Text>}</> : lines.length === 0 && emptyMessage ? <Text dimColor={true}>{truncate(emptyMessage, actualWidth)}</Text> : <>{lines.map((line_0, index) => { |
| 84 | const textWidth = Math.max(10, actualWidth - (maxTimestampWidth > 0 ? maxTimestampWidth + 2 : 0)); |
| 85 | return <Text key={index}>{maxTimestampWidth > 0 && <><Text dimColor={true}>{(line_0.timestamp || "").padEnd(maxTimestampWidth)}</Text>{" "}</>}<Text>{truncate(line_0.text, textWidth)}</Text></Text>; |
| 86 | })}{footer && <Text dimColor={true} italic={true}>{truncate(footer, actualWidth)}</Text>}</>; |
| 87 | $[4] = actualWidth; |
| 88 | $[5] = customContent; |
| 89 | $[6] = emptyMessage; |
| 90 | $[7] = footer; |
| 91 | $[8] = lines; |
| 92 | $[9] = maxTimestampWidth; |
| 93 | $[10] = t3; |
| 94 | } else { |
| 95 | t3 = $[10]; |
| 96 | } |
| 97 | let t4; |
| 98 | if ($[11] !== actualWidth || $[12] !== t2 || $[13] !== t3) { |
| 99 | t4 = <Box flexDirection="column" width={actualWidth}>{t2}{t3}</Box>; |
| 100 | $[11] = actualWidth; |
| 101 | $[12] = t2; |
| 102 | $[13] = t3; |
| 103 | $[14] = t4; |
| 104 | } else { |
| 105 | t4 = $[14]; |
| 106 | } |
| 107 | return t4; |
| 108 | } |