import { toast } from 'react-toastify'; import { useTranslation } from 'react-i18next'; // Custom message component const LoginMessage = (props: ToastLoginProps) => { const { t } = useTranslation(); const handleClick = () => { const currentUrl = window.location.href; const redirect = encodeURIComponent(props?.redirectUrl || currentUrl); const loginUrl = props?.loginUrl || '/user/login/'; const newUrl = location.origin + loginUrl + '?redirect=' + redirect; window.open(newUrl, '_self'); }; return (
{t('Please login')}
{t('Click here to go to the login page.')}