import React from "react"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; import { toast } from "react-toastify"; import Modal from "../../ui/Modal"; const StyledUrl = styled.div` background-color: var(--color-midGrey); padding: 0.5em; border-radius: 2px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 2em; & span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } & img { margin-left: 1em; cursor: pointer; } `; const InviteModal = ({ show, setShow, welcome = true }) => { const { t } = useTranslation(); const currentUrl = window.location.href; const handleCopy = async () => { await navigator.clipboard.writeText(window.location.href); toast.info(t("Url copied to clipboard!"), { autoClose: 1000 }); }; return (

{t("Share this link with your friends")}

{currentUrl} {t("Copy")}

{t( "Share this link with your friends and start playing immediately." )}

{welcome && ( )}
); }; export default InviteModal;