From 21b91f083da0fad2f91ad14b4a6b6f1c530d2a39 Mon Sep 17 00:00:00 2001 From: Rohit Rajan Date: Tue, 9 Sep 2025 16:41:05 +0530 Subject: [PATCH] feat: add loading spinner --- src/components/robot/RecordingsTable.tsx | 65 ++++++++++++++++++++---- 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/src/components/robot/RecordingsTable.tsx b/src/components/robot/RecordingsTable.tsx index 6ea86f74..4b0a99af 100644 --- a/src/components/robot/RecordingsTable.tsx +++ b/src/components/robot/RecordingsTable.tsx @@ -21,6 +21,7 @@ import { Menu, ListItemIcon, ListItemText, + CircularProgress, FormControlLabel, Checkbox, } from "@mui/material"; @@ -154,6 +155,7 @@ export const RecordingsTable = ({ const [searchTerm, setSearchTerm] = React.useState(''); const [isWarningModalOpen, setWarningModalOpen] = React.useState(false); const [activeBrowserId, setActiveBrowserId] = React.useState(''); + const [isFetching, setIsFetching] = React.useState(true); const columns = useMemo(() => [ { id: 'interpret', label: t('recordingtable.run'), minWidth: 80 }, @@ -270,6 +272,8 @@ export const RecordingsTable = ({ } catch (error) { console.error('Error fetching recordings:', error); notify('error', t('recordingtable.notifications.fetch_error')); + } finally { + setIsFetching(false); } }, [setRecordings, notify, t]); @@ -513,7 +517,44 @@ export const RecordingsTable = ({ - + + {isFetching ? ( + + + + ) : filteredRows.length === 0 ? ( + + + {debouncedSearchTerm ? t('recordingtable.placeholder.search') : t('recordingtable.placeholder.title')} + + + {debouncedSearchTerm + ? t('recordingtable.search_criteria') + : t('recordingtable.placeholder.body') + } + + + ) : ( + <> + @@ -538,17 +579,19 @@ export const RecordingsTable = ({ ))}
-
+
- + + + )} setWarningModalOpen(false)} modalStyle={modalStyle}>
{t('recordingtable.warning_modal.title')}