mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-09 02:28:20 +00:00
feat: implement PageLoader component and register maritime loader as the default theme loader
This commit is contained in:
26
libs/ui/src/lib/feedback/PageLoader.tsx
Normal file
26
libs/ui/src/lib/feedback/PageLoader.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user