import { memo, useRef } from '@teact'; import type { ApiStarGiftUnique } from '../../../api/types'; import { IS_TOUCH_ENV } from '../../../util/browser/windowEnvironment.ts'; import buildClassName from '../../../util/buildClassName.ts'; import { getGiftAttributes } from '../../common/helpers/gifts'; import useFlag from '../../../hooks/useFlag.ts'; import { type ObserveFn } from '../../../hooks/useIntersectionObserver'; import RadialPatternBackground from '../../common/profile/RadialPatternBackground'; import StickerView from '../../common/StickerView'; import styles from './WebPageUniqueGift.module.scss'; type OwnProps = { gift: ApiStarGiftUnique; observeIntersectionForLoading?: ObserveFn; observeIntersectionForPlaying?: ObserveFn; onClick?: NoneToVoidFunction; }; const STAR_GIFT_STICKER_SIZE = 120; const WebPageUniqueGift = ({ gift, observeIntersectionForLoading, observeIntersectionForPlaying, onClick, }: OwnProps) => { const stickerRef = useRef(); const { backdrop, model, pattern, } = getGiftAttributes(gift)!; const [isHover, markHover, unmarkHover] = useFlag(); const backgroundColors = [backdrop!.centerColor, backdrop!.edgeColor]; return (
); }; export default memo(WebPageUniqueGift);