fix: loading skeleton appearing out of order in history table (#1759)

This commit is contained in:
Shuchang Zheng
2025-02-12 03:52:39 +08:00
committed by GitHub
parent 4999d58743
commit 5db9a3890c

View File

@@ -70,23 +70,22 @@ function RunHistory() {
</TableRow> </TableRow>
</TableHeader> </TableHeader>
<TableBody> <TableBody>
{isFetching {isFetching ? (
? Array.from({ length: 10 }).map((_, index) => ( Array.from({ length: 10 }).map((_, index) => (
<TableRow key={index}> <TableRow key={index}>
<TableCell colSpan={4}> <TableCell colSpan={4}>
<Skeleton className="h-4 w-full" /> <Skeleton className="h-4 w-full" />
</TableCell> </TableCell>
</TableRow> </TableRow>
)) ))
: null} ) : runs?.length === 0 ? (
{!isFetching && runs?.length === 0 ? (
<TableRow> <TableRow>
<TableCell colSpan={4}> <TableCell colSpan={4}>
<div className="text-center">No runs found</div> <div className="text-center">No runs found</div>
</TableCell> </TableCell>
</TableRow> </TableRow>
) : null} ) : (
{runs?.map((run) => { runs?.map((run) => {
if (isTask(run)) { if (isTask(run)) {
return ( return (
<TableRow <TableRow
@@ -141,7 +140,8 @@ function RunHistory() {
</TableCell> </TableCell>
</TableRow> </TableRow>
); );
})} })
)}
</TableBody> </TableBody>
</Table> </Table>
<Pagination className="pt-2"> <Pagination className="pt-2">