import React from 'react'; import { Button, Icon } from 'UI'; import copy from 'copy-to-clipboard'; import { connectPlayer } from 'Player'; interface Props { content: string; time: any; } function SessionCopyLink({ content = '', time }: Props) { const [copied, setCopied] = React.useState(false); const copyHandler = () => { setCopied(true); copy(window.location.origin + window.location.pathname + '?jumpto=' + Math.round(time)); setTimeout(() => { setCopied(false); }, 1000); }; return (
{/* */} {copied &&
Copied
}
); } const SessionCopyLinkCompo = connectPlayer((state: any) => ({ time: state.time, }))(SessionCopyLink); export default React.memo(SessionCopyLinkCompo);