feat(base): show table skeleton instead of centered loader on load

This commit is contained in:
Philipinho
2026-04-18 22:22:49 +01:00
parent b01f6e9af9
commit 321184394d
2 changed files with 3 additions and 13 deletions
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo } from "react";
import { Loader, Text, Stack } from "@mantine/core";
import { Text, Stack } from "@mantine/core";
import { useAtom } from "jotai";
import { IconDatabase } from "@tabler/icons-react";
import { useTranslation } from "react-i18next";
@@ -20,6 +20,7 @@ import { useBaseTable } from "@/features/base/hooks/use-base-table";
import { useRowSelection } from "@/features/base/hooks/use-row-selection";
import { GridContainer } from "@/features/base/components/grid/grid-container";
import { BaseToolbar } from "@/features/base/components/base-toolbar";
import { BaseTableSkeleton } from "@/features/base/components/base-table-skeleton";
import classes from "@/features/base/styles/grid.module.css";
type BaseTableProps = {
@@ -155,11 +156,7 @@ export function BaseTable({ baseId }: BaseTableProps) {
);
if (baseLoading || rowsLoading) {
return (
<div className={classes.loadingOverlay}>
<Loader size="md" />
</div>
);
return <BaseTableSkeleton />;
}
if (baseError) {
@@ -287,13 +287,6 @@
gap: var(--mantine-spacing-xs);
}
.loadingOverlay {
display: flex;
align-items: center;
justify-content: center;
padding: var(--mantine-spacing-xl);
}
.primaryCell {
font-weight: 500;
}