import { storiesOf } from '@storybook/react'; import * as React from 'react'; import { useCopyToClipboard } from '../src'; import ShowDocs from './util/ShowDocs'; const Demo = () => { const [text, setText] = React.useState(''); const [state, copyToClipboard] = useCopyToClipboard(); return (
Unable to copy value: {state.error.message}
) : ( state.value && ( <>Copied {state.value} {state.noUserInteraction ? 'without' : 'with'} user interaction
> ) )}