import React from 'react'; import { Button, Icon } from 'UI'; import copy from 'copy-to-clipboard'; import { PlayerContext } from 'App/components/Session/playerContext'; import { observer } from 'mobx-react-lite'; function SessionCopyLink() { const [copied, setCopied] = React.useState(false); const { store } = React.useContext(PlayerContext) const time = store.get().time const copyHandler = () => { setCopied(true); copy(window.location.origin + window.location.pathname + '?jumpto=' + Math.round(time)); setTimeout(() => { setCopied(false); }, 1000); }; return (
{copied &&
Copied
}
); } export default observer(SessionCopyLink);