import * as React from 'react'; import { Box, Loader, LoadingOverlay, Stack } from '@mantine/core'; /** * A blurred overlay that can be used to show a loading spinner and/or a loading text. * The overlay is blurred and covers the whole screen or the parent element. * Use the `visible` prop to show the overlay without the loading spinner and its children. */ export function BlurredOverlay({ // eslint-disable-next-line react/jsx-no-useless-fragment children = <>, // eslint-disable-next-line react/jsx-no-useless-fragment loadingText = <>, loaderProps = { color: `dvGray.6`, }, visible = false, loading = false, dataTestId, }: { children?: React.ReactNode; loadingText?: React.ReactNode; loaderProps?: React.ComponentPropsWithoutRef; loading?: boolean; visible?: boolean; dataTestId?: string; }) { return ( {loading ? ( <> {loadingText} ) : ( {children} )} ), }} /> ); }