import React from 'react';
import { storiesOf } from '@storybook/react';

// eslint-disable-next-line import/named
import { withNotes, WithNotes, withMarkdownNotes } from '@storybook/addon-notes';
import { action } from '@storybook/addon-actions';
import BaseButton from '../components/BaseButton';
import markdownNotes from './notes/notes.md';

storiesOf('Addons|Notes', module)
  .add(
    'withNotes',
    withNotes(
      'This is the notes for a button. This is helpful for adding details about a story in a separate panel.'
    )(() => <BaseButton label="Button with notes - check the notes panel for details" />)
  )
  .add(
    'withNotes rendering imported markdown',
    withNotes(markdownNotes)(() => (
      <BaseButton label="Button with notes - check the notes panel for details" />
    ))
  )
  .add(
    'withNotes rendering inline, github-flavored markdown',
    withMarkdownNotes(`
    # Documentation

    This is inline github-flavored markdown!

    ## Example Usage
    ~~~js
    storiesOf('Addons|Notes', module)
    .add(
      'withNotes rendering imported markdown',
      withNotes(markdownNotes)(() => (
        <BaseButton label="Button with notes - check the notes panel for details" />
      ))
    )
    ~~~
    `)(() => (
      <BaseButton label="Button with notes from inline github-flavored markdown - check the notes panel for details" />
    ))
  )
  .add('using deprecated API', () => (
    <WithNotes notes="Hello">
      <BaseButton onClick={action('clicked')} label="😀 😎 👍 💯" />
    </WithNotes>
  ));

@@ -893,20 +893,16 @@
 Notes(%60%0A
-    
 # Docume
@@ -910,20 +910,16 @@
 tation%0A%0A
-    
 This is 
@@ -952,20 +952,16 @@
 kdown!%0A%0A
-    
 ## Examp
@@ -973,22 +973,14 @@
 age%0A
-    
 ~~~js%0A
-    
 stor
@@ -1009,18 +1009,16 @@
 module)%0A
-  
   .add(%0A
@@ -1021,18 +1021,16 @@
 dd(%0A    
- 
- 
 'withNot
@@ -1066,18 +1066,16 @@
 n',%0A    
-  
 withNote
@@ -1101,26 +1101,24 @@
  =%3E (%0A      
- 
- 
 %3CBaseButton 
@@ -1190,23 +1190,15 @@
     
-  
 ))%0A
-  
   )%0A
-    
 ~~~%0A

Fix example indentation