'use client';
import { usePathname } from 'next/navigation.js';
import React from 'react';
import { useAuth } from '../../providers/Auth/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { DefaultAccountIcon } from './Default/index.js';
import Gravatar from './Gravatar/index.js';
const Account = ()=>{
    const { admin: { avatar: Avatar }, routes: { admin: adminRoute } } = useConfig();
    const { user } = useAuth();
    const pathname = usePathname();
    const isOnAccountPage = pathname === `${adminRoute}/account`;
    if (!user?.email || Avatar === 'default') return /*#__PURE__*/ React.createElement(DefaultAccountIcon, {
        active: isOnAccountPage
    });
    if (Avatar === 'gravatar') return /*#__PURE__*/ React.createElement(Gravatar, null);
    if (Avatar) return /*#__PURE__*/ React.createElement(Avatar, {
        active: isOnAccountPage
    });
    return /*#__PURE__*/ React.createElement(DefaultAccountIcon, {
        active: isOnAccountPage
    });
};
export default Account;
function isClassComponent(component) {
    return typeof component === 'function' && !!component.prototype.isReactComponent;
}
function isFunctionComponent(component) {
    return typeof component === 'function' && String(component).includes('return React.createElement');
}
function isReactComponent(component) {
    return isClassComponent(component) || isFunctionComponent(component);
}

//# sourceMappingURL=index.js.map