'use client'
import { jsxs, jsx } from 'react/jsx-runtime';
import { useMemo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Typography } from '../../../../../components/Typography/Typography.js';
import { TypographyButton } from '../../../../../components/TypographyButton/TypographyButton.js';
import { ReactComponent as SvgChevronLeft } from '../../../../../shared/assets/chevron-left.js';
import { ReactComponent as SvgSession } from '../../../../../shared/assets/session.js';
import '@dynamic-labs/iconic';
import '../../../../../context/ViewContext/ViewContext.js';
import '@dynamic-labs-sdk/client/core';
import '@dynamic-labs/sdk-api-core';
import '../../../../../client/client.js';
import '@dynamic-labs-sdk/client';
import '../../../../../config/ApiEndpoint.js';
import '@dynamic-labs/wallet-connector-core';
import '../../../../../shared/logger.js';
import '@dynamic-labs/wallet-book';
import '@dynamic-labs/utils';
import '../../../../../utils/constants/colors.js';
import '../../../../../utils/constants/values.js';
import '../../../../../shared/consts/index.js';
import '../../../../../../../_virtual/_tslib.js';
import '@dynamic-labs/multi-wallet';
import 'react-international-phone';
import '../../../../../store/state/nonce/nonce.js';
import '@dynamic-labs/locale';
import '../../../../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../../../../store/state/primaryWalletId/primaryWalletId.js';
import '../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import { isZKSyncEnabled } from '../../../../../utils/functions/isZKSyncEnabled/isZKSyncEnabled.js';
import '../../../../../events/dynamicEvents.js';
import { useProjectSettings } from '../../../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
import { classNames } from '../../../../../utils/functions/classNames/classNames.js';
import { useWidgetContext } from '../../../context/DynamicWidgetContext.js';

const ZKSyncSessionsSection = ({ isLoading = false }) => {
    const { t } = useTranslation();
    const projectSettings = useProjectSettings();
    const { setDynamicWidgetView } = useWidgetContext();
    const isZKSyncWallet = useMemo(() => isZKSyncEnabled(projectSettings), [projectSettings]);
    const handleSessionManagementClick = useCallback(() => setDynamicWidgetView('session-management'), [setDynamicWidgetView]);
    if (!isZKSyncWallet) {
        return null;
    }
    return (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: classNames('settings-view__body__section__title', 'settings-view__body__section__title__info-icon'), children: jsx(Typography, { copykey: 'dyn_settings.session_management.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.session_management.title') }) }), jsx(TypographyButton, { dataTestId: 'session-management-button', onClick: handleSessionManagementClick, buttonClassName: 'settings-view__body__section__button', startSlot: 
                // eslint-disable-next-line react/jsx-wrap-multilines
                jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgSession, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.session_management.session_management_button', children: t('dyn_settings.session_management.session_management_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), disabled: isLoading, showInternalLoading: false })] }));
};

export { ZKSyncSessionsSection };
