mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-30 01:20:07 +08:00
refactor(connections): align perf replay with visible row derivation
This commit is contained in:
@@ -6,8 +6,7 @@ import { createRoot } from 'react-dom/client'
|
||||
import { SWRConfig } from 'swr'
|
||||
|
||||
import { VirtualList } from '../../src/components/base/virtual-list'
|
||||
import { ConnectionRowItem } from '../../src/components/connection/connection-row-item'
|
||||
import { useConnectionRowViews } from '../../src/components/connection/connection-row-view'
|
||||
import { VisibleConnectionRowItem } from '../../src/components/connection/connection-row-item'
|
||||
import LogItem from '../../src/components/log/log-item'
|
||||
import { initializeLanguage } from '../../src/services/i18n'
|
||||
import { setPreloadConfig } from '../../src/services/preload'
|
||||
@@ -35,10 +34,9 @@ export function Components() {
|
||||
}),
|
||||
[],
|
||||
)
|
||||
const rows = useConnectionRowViews(connections)
|
||||
return (
|
||||
<VirtualList
|
||||
count={scenario === 'logs' ? logs.length : rows.length}
|
||||
count={scenario === 'logs' ? logs.length : connections.length}
|
||||
estimateSize={scenario === 'logs' ? 50 : 56}
|
||||
style={{ height: 640, margin: 24 }}
|
||||
renderItem={(index) =>
|
||||
@@ -48,8 +46,8 @@ export function Components() {
|
||||
searchState={searchState}
|
||||
/>
|
||||
) : (
|
||||
<ConnectionRowItem
|
||||
row={rows[index]}
|
||||
<VisibleConnectionRowItem
|
||||
connection={connections[index]}
|
||||
closed={false}
|
||||
onShowDetail={() => {}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user