From 28c3c3241d23181199bb886cc8b6d3f7406cfe42 Mon Sep 17 00:00:00 2001 From: Brandon Keiji Date: Thu, 15 May 2025 22:20:33 +0000 Subject: [PATCH] refactor: shorten static history section code (#370) --- packages/cli/src/ui/App.tsx | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 50a290df..ac196f18 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -212,25 +212,17 @@ export const App = ({ * content is set it'll flush content to the terminal and move the area which it's "clearing" * down a notch. Without Static the area which gets erased and redrawn continuously grows. */} - - {(item, index) => { - if (item === 'header') { - return ( - -
- - - ); - } - - const historyItem = item as HistoryItem; - return ( - - ); - }} + +
+ + , + ...history.map((h) => ), + ]} + > + {(item) => item} {pendingHistoryItem && (