2025-09-30 00:03:29 +07:00
|
|
|
import { Spin } from 'antd';
|
|
|
|
|
import { createPortal } from 'react-dom';
|
|
|
|
|
|
|
|
|
|
import { useCreateAlertState } from './context';
|
|
|
|
|
|
2025-09-09 14:56:29 +07:00
|
|
|
// UI side feature flag
|
|
|
|
|
export const showNewCreateAlertsPage = (): boolean =>
|
|
|
|
|
localStorage.getItem('showNewCreateAlertsPage') === 'true';
|
2025-09-23 22:36:40 +07:00
|
|
|
|
|
|
|
|
// UI side FF to switch between the 2 layouts of the create alert page
|
|
|
|
|
// Layout 1 - Default layout
|
|
|
|
|
// Layout 2 - Condensed layout
|
|
|
|
|
export const showCondensedLayout = (): boolean =>
|
|
|
|
|
localStorage.getItem('showCondensedLayout') === 'true';
|
2025-09-30 00:03:29 +07:00
|
|
|
|
|
|
|
|
export function Spinner(): JSX.Element | null {
|
|
|
|
|
const { isCreatingAlertRule } = useCreateAlertState();
|
|
|
|
|
|
|
|
|
|
if (!isCreatingAlertRule) return null;
|
|
|
|
|
|
|
|
|
|
return createPortal(
|
|
|
|
|
<div className="sticky-page-spinner">
|
|
|
|
|
<Spin size="large" spinning />
|
|
|
|
|
</div>,
|
|
|
|
|
document.body,
|
|
|
|
|
);
|
|
|
|
|
}
|