import { LinkIcon } from '@heroicons/react/outline' import toast from 'react-hot-toast' import { Contract } from 'common/contract' import { contractPath } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { Modal } from '../layout/modal' import { Row } from '../layout/row' import { ShareEmbedButton } from '../share-embed-button' import { Title } from '../title' import { TweetButton } from '../tweet-button' import { Button } from '../button' import { copyToClipboard } from 'web/lib/util/copy' import { track, withTracking } from 'web/lib/service/analytics' import { ENV_CONFIG } from 'common/envs/constants' import { User } from 'common/user' import { SiteLink } from '../site-link' import { formatMoney } from 'common/util/format' import { REFERRAL_AMOUNT } from 'common/economy' import { CreateChallengeModal } from 'web/components/challenges/create-challenge-modal' import { useState } from 'react' import { CHALLENGES_ENABLED } from 'common/challenge' import ChallengeIcon from 'web/lib/icons/challenge-icon' import { QRCode } from '../qr-code' export function ShareModal(props: { contract: Contract user: User | undefined | null isOpen: boolean setOpen: (open: boolean) => void }) { const { contract, user, isOpen, setOpen } = props const { outcomeType, resolution } = contract const [openCreateChallengeModal, setOpenCreateChallengeModal] = useState(false) const linkIcon =