// Dependencies import { cloudflareImageUrl } from 'shared/utils.mjs' // Context import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs' // Hooks import { useState, useContext } from 'react' import { useTranslation } from 'next-i18next' import { useAccount } from 'shared/hooks/use-account.mjs' import { useBackend } from 'shared/hooks/use-backend.mjs' // Components import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs' import { ContinueButton } from 'shared/components/buttons/continue-button.mjs' import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs' import { PassiveImageInput } from 'shared/components/inputs.mjs' import { DynamicMdx } from 'shared/components/mdx/dynamic.mjs' export const ns = ['account', 'status'] export const ImgSettings = ({ welcome = false }) => { const { account, setAccount } = useAccount() const backend = useBackend() const { setLoadingStatus } = useContext(LoadingStatusContext) const { t, i18n } = useTranslation(ns) const [img, setImg] = useState('') const save = async () => { setLoadingStatus([true, 'processingUpdate']) const result = await backend.updateAccount({ img }) if (result.success) { setAccount(result.data.account) setLoadingStatus([true, 'settingsSaved', true, true]) } else setLoadingStatus([true, 'backendError', true, false]) } const nextHref = '/docs/about/guide' return (
{!welcome || img !== false ? ( img ) : null} val.length > 0} docs={} /> {welcome ? ( <> {welcomeSteps[account.control].length > 0 ? ( <> 7 / {welcomeSteps[account.control].length} ) : null} ) : ( <> )}
) }