'use client'
import { jsx } from 'react/jsx-runtime';
import { useTranslation } from 'react-i18next';
import '../../../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
import { useWidgetContext } from '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
import '@dynamic-labs/sdk-api-core';
import '../../../../utils/constants/values.js';
import '@dynamic-labs/utils';
import '../../../../../../_virtual/_tslib.js';
import '@dynamic-labs/multi-wallet';
import '../../../../shared/logger.js';
import 'react-international-phone';
import '../../../../utils/constants/colors.js';
import '@dynamic-labs/iconic';
import '@dynamic-labs/wallet-connector-core';
import 'react';
import { ReactComponent as SvgPencil } from '../../../../shared/assets/pencil.js';
import '../../../../context/ViewContext/ViewContext.js';
import '@dynamic-labs/wallet-book';
import '../../../../shared/consts/index.js';
import { getEditableUserProfileFields } from '../../../../utils/functions/getUserProfileFields/getUserProfileFields.js';
import '../../../../store/state/nonce/nonce.js';
import '@dynamic-labs-wallet/browser-wallet-client';
import '@dynamic-labs-sdk/client/core';
import 'eventemitter3';
import '@dynamic-labs-sdk/client';
import '../../../../config/ApiEndpoint.js';
import '../../../../events/dynamicEvents.js';
import '@dynamic-labs/locale';
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../../../store/state/primaryWalletId/primaryWalletId.js';
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import '../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
import { TypographyButton } from '../../../TypographyButton/TypographyButton.js';

const EditProfileButton = () => {
    var _a, _b;
    const { t } = useTranslation();
    const { projectSettings } = useInternalDynamicContext();
    const { setDynamicWidgetView } = useWidgetContext();
    // Allow to navigate to edit profile view when there are fields what can be edited
    const editableUserFields = getEditableUserProfileFields([
        ...((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc) !== null && _a !== void 0 ? _a : []),
        ...((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.customFields) !== null && _b !== void 0 ? _b : []),
    ]);
    if (!(editableUserFields === null || editableUserFields === void 0 ? void 0 : editableUserFields.length))
        return null;
    return (jsx(TypographyButton, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
            color: 'secondary',
            variant: 'button_tertiary',
        }, copykey: 'dyn_user_profile.edit_profile_button', onClick: () => setDynamicWidgetView('edit-profile'), startSlot: jsx(SvgPencil, {}), children: t('dyn_user_profile.edit_profile_button') }));
};

export { EditProfileButton };
