mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
28 lines
775 B
TypeScript
28 lines
775 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import type {LoadingMaskProps} from 'sentry/components/loadingMask';
|
|
import LoadingMask from 'sentry/components/loadingMask';
|
|
|
|
interface TransparentLoadingMaskProps extends LoadingMaskProps {
|
|
visible: boolean;
|
|
children?: React.ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
const TransparentLoadingMask = styled(
|
|
({className, visible, children, ...props}: TransparentLoadingMaskProps) => {
|
|
const other = visible ? {...props, 'data-test-id': 'loading-placeholder'} : props;
|
|
return (
|
|
<LoadingMask className={className} {...other}>
|
|
{children}
|
|
</LoadingMask>
|
|
);
|
|
}
|
|
)<TransparentLoadingMaskProps>`
|
|
${p => !p.visible && 'display: none;'};
|
|
opacity: 0.4;
|
|
z-index: 1;
|
|
`;
|
|
|
|
export default TransparentLoadingMask;
|