import type { FC } from '../../lib/teact/teact'; import React, { useCallback, memo } from '../../lib/teact/teact'; import { getActions } from '../../global'; import type { ApiPhoto } from '../../api/types'; import useLang from '../../hooks/useLang'; import Modal from '../ui/Modal'; import Button from '../ui/Button'; export type OwnProps = { isOpen: boolean; photo: ApiPhoto; profileId: string; onConfirm?: NoneToVoidFunction; onClose: NoneToVoidFunction; }; const DeleteProfilePhotoModal: FC = ({ isOpen, photo, profileId, onClose, onConfirm, }) => { const { deleteProfilePhoto, } = getActions(); const handleDeletePhoto = useCallback(() => { onConfirm?.(); deleteProfilePhoto({ photo, profileId }); onClose(); }, [onConfirm, deleteProfilePhoto, photo, profileId, onClose]); const lang = useLang(); return ( ); }; export default memo(DeleteProfilePhotoModal);