import { useTranslation } from 'react-i18next'; import CloseIcon from "../icons/CloseIcon"; import { MAX_SOURCE_SIZE_MB as MAX_PHOTO_SIZE_MB } from "../../hooks/useImageUpload"; // ─── Input field component ─────────────────────────────────────────────────── function InputField({ label, error, ...props }) { return (
{error &&

{error}

}
); } // ─── Image upload component ────────────────────────────────────────────────── function ImageUpload({ displayImage, imgError, compressing, fileInputRef, onFileChange, onRemove, // Перетаскивание фото (десктоп): обработчики зоны и «файл над зоной». // Пустые props — перетаскивание выключено (мобильная раскладка). dropZoneProps = {}, dragOver = false, }) { const { t } = useTranslation(); const dropEnabled = Object.keys(dropZoneProps).length > 0; return (
{displayImage ? (
profile {dragOver && {t('profile.dropReplace')}}
) : ( )} {imgError &&

{imgError}

}

{t('profile.photoHint', { maxSize: MAX_PHOTO_SIZE_MB })}

); } // ─── Login field ───────────────────────────────────────────────────────────── function LoginField({ form, errors, onChange }) { const { t } = useTranslation(); return ( onChange("login", e.target.value)} /> ); } // ─── Name fields row ───────────────────────────────────────────────────────── function NameFieldsRow({ form, errors, onChange }) { const { t } = useTranslation(); return (
onChange("firstName", e.target.value)} /> onChange("lastName", e.target.value)} />
); } // ─── Contact fields ───────────────────────────────────────────────────────── // Email в окне профиля не показываем: он не редактируется здесь, но остаётся // в состоянии формы и уходит при сохранении без изменений. function ContactFields({ form, errors, onPhoneChange }) { const { t } = useTranslation(); return ( onPhoneChange(e.target.value)} /> ); } // ─── Submit button ────────────────────────────────────────────────────────── function SubmitButton({ loading }) { const { t } = useTranslation(); return ( ); } // ─── Modal header ────────────────────────────────────────────────────────── function ModalHeader({ onClose }) { const { t } = useTranslation(); return (
{t('profile.editTitle')}
); } export { InputField, ImageUpload, LoginField, NameFieldsRow, ContactFields, SubmitButton, ModalHeader };