import { classNames, hasReactNode } from '@vkontakte/vkjs'; import type { HTMLAttributesWithRootRef } from '../../types'; import { RootComponent } from '../RootComponent/RootComponent'; import { Footnote } from '../Typography/Footnote/Footnote'; import { ScreenSpinnerContext } from './context'; import { type ScreenSpinnerProps } from './types'; import styles from './ScreenSpinner.module.css'; import stylesDelay from '../../styles/animationVisibilityDelay.module.css'; const stateClassNames = { cancelable: styles.stateCancelable, done: styles.stateDone, error: styles.stateError, custom: styles.stateCustom, }; const modeClassNames = { shadow: styles.modeShadow, overlay: styles.modeOverlay, }; type ScreenSpinnerContainerProps = HTMLAttributesWithRootRef & Pick; export const ScreenSpinnerContainer = ({ state = 'loading', mode = 'shadow', customIcon, label, children, visibilityDelay, ...restProps }: ScreenSpinnerContainerProps) => { return (
{children}
{hasReactNode(label) && ( {label} )}
); };