/* global Runtime */ import { h, Component } from 'preact'; import PropTypes from 'prop-types'; import { Button } from '@crayons'; const CopyIcon = () => ( Copy Invitation Url ); export class InvitationLinkManager extends Component { static propTypes = { invitationLink: PropTypes.string.isRequired, currentMembership: PropTypes.isRequired, }; constructor(props) { super(props); this.state = { invitationLink: props.invitationLink, showImageCopiedMessage: false, currentMembership: props.currentMembership, }; } copyText = () => { this.imageMarkdownInput = document.getElementById( 'chat-channel-unviation-url', ); Runtime.copyToClipboard(this.imageMarkdownInput.value).then(() => { this.setState({ showImageCopiedMessage: true }); }); }; render() { const { showImageCopiedMessage, invitationLink, currentMembership, } = this.state; if (currentMembership.role !== 'mod') { return null; } return (

Invitation Link

); } }