diff --git a/src/components/robot/RecordingsTable.tsx b/src/components/robot/RecordingsTable.tsx index 8b4143a2..f0c0a4da 100644 --- a/src/components/robot/RecordingsTable.tsx +++ b/src/components/robot/RecordingsTable.tsx @@ -148,7 +148,6 @@ export const RecordingsTable = ({ const [rows, setRows] = React.useState([]); const [isModalOpen, setModalOpen] = React.useState(false); const [searchTerm, setSearchTerm] = React.useState(''); - const [isLoading, setIsLoading] = React.useState(true); const columns = useMemo(() => [ { id: 'interpret', label: t('recordingtable.run'), minWidth: 80 }, @@ -202,7 +201,6 @@ export const RecordingsTable = ({ }; const fetchRecordings = useCallback(async () => { - setIsLoading(true); try { const recordings = await getStoredRecordings(); if (recordings) { @@ -222,15 +220,13 @@ export const RecordingsTable = ({ }) .filter(Boolean) .sort((a, b) => b.parsedDate.getTime() - a.parsedDate.getTime()); - + setRecordings(parsedRows.map((recording) => recording.name)); setRows(parsedRows); } } catch (error) { console.error('Error fetching recordings:', error); notify('error', t('recordingtable.notifications.fetch_error')); - } finally { - setIsLoading(false); } }, [setRecordings, notify, t]); @@ -359,39 +355,32 @@ export const RecordingsTable = ({ - {isLoading ? ( - - - - ) : ( - - - - - {columns.map((column) => ( - - {column.label} - - ))} - - - - {visibleRows.map((row) => ( - + +
+ + + {columns.map((column) => ( + + {column.label} + ))} - -
-
- )} + + + + {visibleRows.map((row) => ( + + ))} + + + = ({ const [rows, setRows] = useState([]); const [searchTerm, setSearchTerm] = useState(''); - const [isLoading, setIsLoading] = useState(true); const [paginationStates, setPaginationStates] = useState({}); @@ -212,7 +211,6 @@ export const RunsTable: React.FC = ({ const fetchRuns = useCallback(async () => { try { - setIsLoading(true); const runs = await getStoredRuns(); if (runs) { const parsedRows: Data[] = runs.map((run: any, index: number) => ({ @@ -225,8 +223,6 @@ export const RunsTable: React.FC = ({ } } catch (error) { notify('error', t('runstable.notifications.fetch_error')); - } finally { - setIsLoading(false); } }, [notify, t]); @@ -364,14 +360,6 @@ export const RunsTable: React.FC = ({ : ; }, [accordionSortConfigs]); - if (isLoading) { - return ( - - - - ); - } - return (