feat: replace loading spinners with skeletons

This commit is contained in:
2026-08-27 21:43:57 +03:00
parent 7d748a65d3
commit 71a214d7ad
15 changed files with 204 additions and 58 deletions
+3 -5
View File
@@ -1,22 +1,20 @@
import { Button, Loader, Paper, Stack, Text, Title } from "@mantine/core";
import { Button, Paper, Stack, Text, Title } from "@mantine/core";
import type { FC, ReactNode } from "react";
type StateViewProps = {
title: string;
text: string;
action?: ReactNode;
loading?: boolean;
error?: boolean;
};
const StateView: FC<StateViewProps> = (props) => {
const { title, text, action, loading = false, error = false } = props;
const role = loading ? "status" : error ? "alert" : undefined;
const { title, text, action, error = false } = props;
const role = error ? "alert" : undefined;
return (
<Paper p="xl" radius="md" shadow="xs" withBorder role={role}>
<Stack align="flex-start" gap="sm">
{loading ? <Loader aria-label={title} size="sm" /> : null}
<Title order={2}>{title}</Title>
<Text c="dimmed">{text}</Text>
{action}