import { memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import type { ApiPeer } from '../../api/types'; import { getPeerTitle, isApiPeerUser } from '../../global/helpers/peers'; import { selectPeer, selectTheme, selectThemeValues } from '../../global/selectors'; import { formatStarsAsIcon } from '../../util/localization/format'; import { LOCAL_TGS_URLS } from '../common/helpers/animatedAssets'; import renderText from '../common/helpers/renderText'; import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useOldLang from '../../hooks/useOldLang'; import AnimatedIconWithPreview from '../common/AnimatedIconWithPreview'; import Icon from '../common/icons/Icon'; import Sparkles from '../common/Sparkles'; import Button from '../ui/Button'; import styles from './RequirementToContactMessage.module.scss'; type OwnProps = { peerId: string; paidMessagesStars?: number; }; type StateProps = { patternColor?: string; peer?: ApiPeer; }; function RequirementToContactMessage({ patternColor, peer, paidMessagesStars, }: OwnProps & StateProps) { const oldLang = useOldLang(); const lang = useLang(); const { openPremiumModal, openStarsBalanceModal } = getActions(); const handleOpenPremiumModal = useLastCallback(() => openPremiumModal()); const handleGetMoreStars = useLastCallback(() => { openStarsBalanceModal({}); }); if (!peer) return undefined; return (