import React from "react";
import Text from "../../../components/Text/Text";
import { Modal } from "../../Modal";
import { CopyToClipboard } from "../../WalletModal";

interface Props {
  inviteUrl: string;
  title: string;
  onDismiss?: () => void;
}

const InviteModal: React.FC<Props> = ({ inviteUrl, title, onDismiss }) => (
  <Modal title={title} onDismiss={onDismiss}>
    <CopyToClipboard toCopy={inviteUrl}>
      <Text fontSize="20px" bold style={{ whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>
        {inviteUrl}
      </Text>
    </CopyToClipboard>
  </Modal>
);

export default InviteModal;
