github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/stories/components/copy-button.stories.js (about)

     1  import hbs from 'htmlbars-inline-precompile';
     2  import { withKnobs, text } from '@storybook/addon-knobs';
     3  
     4  export default {
     5    title: 'Components/Copy Button',
     6    decorators: [withKnobs],
     7  };
     8  
     9  export let CopyButton = () => {
    10    return {
    11      template: hbs`
    12        <h5 class="title is-5">Copy Button</h5>
    13        <span class="tag is-hollow is-small no-text-transform">
    14          {{clipboardText}}
    15          <CopyButton @clipboardText={{clipboardText}} />
    16        </span>
    17        <h5 class="title is-5">Copy Button with content</h5>
    18        <span class="tag is-hollow is-small no-text-transform">
    19          <CopyButton @clipboardText={{clipboardText}}>{{clipboardText}}</CopyButton>
    20        </span>
    21        `,
    22      context: {
    23        clipboardText: text(
    24          'Clipboard Text',
    25          'e8c898a0-794b-9063-7a7f-bf0c4a405f83'
    26        ),
    27      },
    28    };
    29  };