From 90e9c468de39b62f5676d3102175624d66857645 Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Thu, 18 Jun 2026 06:57:53 +0300 Subject: [PATCH] feat: add loading overlay and spinner to PositionGroupTable --- .../pages/broker/BrokerPositionsSection.tsx | 140 ++++++++++-------- 1 file changed, 82 insertions(+), 58 deletions(-) diff --git a/apps/frontend/src/pages/broker/BrokerPositionsSection.tsx b/apps/frontend/src/pages/broker/BrokerPositionsSection.tsx index 7dd2189..5c8cb6c 100644 --- a/apps/frontend/src/pages/broker/BrokerPositionsSection.tsx +++ b/apps/frontend/src/pages/broker/BrokerPositionsSection.tsx @@ -100,7 +100,7 @@ function PositionGroupTable({ const [cursor, setCursor] = useState(undefined); const query = group.type ? { type: group.type, limit: 10, cursor } : { limit: 100, cursor }; - const { data: page, isLoading } = useBrokerPositions(accountId, query); + const { data: page, isLoading, isFetching } = useBrokerPositions(accountId, query); const rawPositions = page?.items ?? []; const positions = group.type @@ -148,10 +148,17 @@ function PositionGroupTable({ - → + {isFetching ? ( + + ) : ( + '→' + )} )} @@ -213,58 +227,68 @@ function PositionGroupTable({ )} {!isLoading && positions.length > 0 && ( -
- - - - - - - - - - - - {positions.map((position) => ( - - - - - - +
+
+
- Тикер - - Название - - Количество - - Цена - - Стоимость -
- - - - {position.name || '-'} - - - {formatQuantity(position.quantity)} - - {formatMoney(position.currentPrice)} - - {formatMoney(position.currentValue)} -
+ + + + + + + - ))} - -
+ Тикер + + Название + + Количество + + Цена + + Стоимость +
+ + + {positions.map((position) => ( + + + + + + + {position.name || '-'} + + + + {formatQuantity(position.quantity)} + + + {formatMoney(position.currentPrice)} + + + {formatMoney(position.currentValue)} + + + ))} + + +
+ {isFetching && ( +
+
+ + Загрузка страницы {pageNumber}… + +
+ )}
)}