feat: implement PageLoader component and register maritime loader as the default theme loader

This commit is contained in:
estifanos
2026-08-14 11:35:34 +00:00
parent 652503d1de
commit f31e75c3de
16 changed files with 219 additions and 36 deletions

View File

@@ -0,0 +1,26 @@
import { Center, Loader, Stack, Text } from '@mantine/core';
import { useTranslation } from 'react-i18next';
interface PageLoaderProps {
/** Visible + accessible label. Defaults to the shared i18n "loading" string. */
label?: string;
/** Container height. Defaults to a full-page fill. */
height?: number | string;
}
/** The full-page/section loading state every screen should use instead of a bare `<Loader />`. */
export function PageLoader({ label, height = '60vh' }: PageLoaderProps) {
const { t } = useTranslation();
const resolvedLabel = label ?? t('loading', 'Loading…');
return (
<Center h={height}>
<Stack align="center" gap="xs">
<Loader size={64} aria-label={resolvedLabel} />
<Text c="dimmed" size="sm">
{resolvedLabel}
</Text>
</Stack>
</Center>
);
}