mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 08:17:22 +00:00
refactor(ui): align visible provider flow data
This commit is contained in:
@@ -49,18 +49,19 @@ export function AccountFlowViz({
|
|||||||
() => new Set(visibleAccounts.map((account) => account.id)),
|
() => new Set(visibleAccounts.map((account) => account.id)),
|
||||||
[visibleAccounts]
|
[visibleAccounts]
|
||||||
);
|
);
|
||||||
const visibleProviderData = useMemo(
|
|
||||||
() => ({
|
|
||||||
...providerData,
|
|
||||||
accounts: visibleAccounts,
|
|
||||||
}),
|
|
||||||
[providerData, visibleAccounts]
|
|
||||||
);
|
|
||||||
const maxRequests = Math.max(...visibleAccounts.map((a) => a.successCount + a.failureCount), 1);
|
const maxRequests = Math.max(...visibleAccounts.map((a) => a.successCount + a.failureCount), 1);
|
||||||
const totalRequests = visibleAccounts.reduce(
|
const totalRequests = visibleAccounts.reduce(
|
||||||
(acc, a) => acc + a.successCount + a.failureCount,
|
(acc, a) => acc + a.successCount + a.failureCount,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
const visibleProviderData = useMemo(
|
||||||
|
() => ({
|
||||||
|
...providerData,
|
||||||
|
accounts: visibleAccounts,
|
||||||
|
totalRequests,
|
||||||
|
}),
|
||||||
|
[providerData, visibleAccounts, totalRequests]
|
||||||
|
);
|
||||||
|
|
||||||
const calculatePaths = useCallback(() => {
|
const calculatePaths = useCallback(() => {
|
||||||
const newPaths = calculateBezierPaths({ containerRef, svgRef, accounts: visibleAccounts });
|
const newPaths = calculateBezierPaths({ containerRef, svgRef, accounts: visibleAccounts });
|
||||||
|
|||||||
Reference in New Issue
Block a user