import { Button, Dialog, DialogContent, DialogTitle, Typography, } from '@mui/material'; import {useTranslation} from 'next-i18next'; import LoginForm from '../LoginForm'; import {useState} from 'react'; import {setCookie} from '../../lib/cookies'; type Props = { open: boolean; toggle: () => void; redirectPath: string; title?: string; content?: string; }; const LoginDialog = (props: Props) => { const {t} = useTranslation(); const { open, toggle, redirectPath, title = t`signin.title`, content = '', } = props; const [sent, setSent] = useState(false); const onSend = () => { setSent(true); setCookie('redirectPath', redirectPath); }; return ( {title} {!sent && ( <> {content && {content}} )} {sent && ( <> {t`signin.check_email`} )} ); }; export default LoginDialog;