'use client';
import React, { Fragment } from 'react';
import { LogOut } from '../../icons/LogOut/index.js';
import { useComponentMap } from '../../index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
const baseClass = 'nav';
const DefaultLogout = ({ Link, tabIndex })=>{
    const { t } = useTranslation();
    const config = useConfig();
    const { admin: { logoutRoute }, routes: { admin } } = config;
    const LinkElement = Link || 'a';
    return /*#__PURE__*/ React.createElement(LinkElement, {
        "aria-label": t('authentication:logOut'),
        className: `${baseClass}__log-out`,
        href: `${admin}${logoutRoute}`,
        tabIndex: tabIndex
    }, /*#__PURE__*/ React.createElement(LogOut, null));
};
const Logout = ({ Link, tabIndex = 0 })=>{
    const { componentMap: { LogoutButton: CustomLogout } } = useComponentMap();
    if (CustomLogout) {
        return /*#__PURE__*/ React.createElement(Fragment, null, CustomLogout);
    }
    return /*#__PURE__*/ React.createElement(DefaultLogout, {
        Link: Link,
        tabIndex: tabIndex
    });
};
export default Logout;

//# sourceMappingURL=index.js.map