'use client';
import * as facelessUIImport from '@faceless-ui/modal';
// TODO: abstract the `next/navigation` dependency out from this component
import { useRouter } from 'next/navigation.js';
import React from 'react';
import { Button } from '../../elements/Button/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
const baseClass = 'stay-logged-in';
const modalSlug = 'stay-logged-in';
const StayLoggedInModal = (props)=>{
    const { Modal, useModal } = facelessUIImport;
    const { refreshCookie } = props;
    const router = useRouter();
    const config = useConfig();
    const { admin: { logoutRoute }, routes: { admin } } = config;
    const { toggleModal } = useModal();
    const { t } = useTranslation();
    return /*#__PURE__*/ React.createElement(Modal, {
        className: baseClass,
        slug: "stay-logged-in"
    }, /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__wrapper`
    }, /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__content`
    }, /*#__PURE__*/ React.createElement("h1", null, t('authentication:stayLoggedIn')), /*#__PURE__*/ React.createElement("p", null, t('authentication:youAreInactive'))), /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__controls`
    }, /*#__PURE__*/ React.createElement(Button, {
        buttonStyle: "secondary",
        onClick: ()=>{
            toggleModal(modalSlug);
            router.push(`${admin}${logoutRoute}`);
        }
    }, t('authentication:logOut')), /*#__PURE__*/ React.createElement(Button, {
        onClick: ()=>{
            refreshCookie();
            toggleModal(modalSlug);
        }
    }, t('authentication:stayLoggedIn')))));
};
export default StayLoggedInModal;

//# sourceMappingURL=index.js.map