mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
refactor: shorten static history section code (#370)
This commit is contained in:
@@ -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"
|
* 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.
|
* down a notch. Without Static the area which gets erased and redrawn continuously grows.
|
||||||
*/}
|
*/}
|
||||||
<Static key={'static-key-' + staticKey} items={['header', ...history]}>
|
<Static
|
||||||
{(item, index) => {
|
key={staticKey}
|
||||||
if (item === 'header') {
|
items={[
|
||||||
return (
|
<Box flexDirection="column" key="header">
|
||||||
<Box flexDirection="column" key={'header-' + index}>
|
<Header />
|
||||||
<Header />
|
<Tips />
|
||||||
<Tips />
|
</Box>,
|
||||||
</Box>
|
...history.map((h) => <HistoryItemDisplay key={h.id} item={h} />),
|
||||||
);
|
]}
|
||||||
}
|
>
|
||||||
|
{(item) => item}
|
||||||
const historyItem = item as HistoryItem;
|
|
||||||
return (
|
|
||||||
<HistoryItemDisplay
|
|
||||||
key={'history-' + historyItem.id}
|
|
||||||
item={historyItem}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Static>
|
</Static>
|
||||||
{pendingHistoryItem && (
|
{pendingHistoryItem && (
|
||||||
<HistoryItemDisplay
|
<HistoryItemDisplay
|
||||||
|
|||||||
Reference in New Issue
Block a user