'use client';
import { FormContext } from './context/form-context';
import { CheckCircleIcon } from '@heroicons/react/24/solid';
import type { PropsWithChildren } from 'react';
import { useContext } from 'react';
import { Background, LoadingSpinner } from 'ui';
function OverlayWrapper({ children }: PropsWithChildren) {
return (
{children}
);
}
export function Overlay() {
const { formStatus } = useContext(FormContext);
if (formStatus === 'pending')
return (
{LoadingSpinner} Загрузка...
);
if (formStatus === 'success')
return (
{' '}
Данные сохранены
);
return false;
}