text: import React from 'react';
  import { storiesOf } from '@storybook/react';
  import { object, text } from '@storybook/addon-knobs';
  import { withDocs } from 'storybook-readme';
  import _ from 'lodash';
  import { BlockLink } from 'components';
  
  import ListOfLinks from './';
  import README from './README.md';
  
  const createItems = (descriptor) =>
    Object.entries(descriptor).map(([title, links]) => ({
      title,
      links: links.map((name, index) => (
        <BlockLink key={index} href={`/link/to/${_.kebabCase(name)}`}>
          {name}
        </BlockLink>
      )),
    }));
  
  storiesOf('Components/ListOfLinks', module)
    .addDecorator(withDocs(README))
    .add('default', () => (
      <ListOfLinks
        title={text('Title', 'Deals in popular destinations')}
        items={createItems(
          object('Items (descriptor)', {
            Queensland: [
              'Tropical North Queensland',
              'Brisbane',
              'Capricorn Region',
              'Sunshine Coast',
            ],
            'New South Wales': [
              'South Coast NSW',
              'Sydney CBD',
              'Sydney Regional',
              'Newcastle & The Hunter',
              'Lord Howe Island',
              'Blue Mountains',
            ],
            'Australian Capital Territory': ['Australian Capital Territory'],
            Victoria: [
              'Melbourne CBD',
              'Phillip Island',
              'Geelong & Great Ocean Road',
              'Murray & Golburn Valleys',
              'Daylesford',
              'Mornington Peninsula',
              'Grampians',
              'Gippsland',
            ],
            Tasmania: [
              'Hobart',
              'Launceston',
              'Regional Hobart & Surrounds',
              'East Coast',
            ],
            'Northern Territory': [
              'Darwin',
              'Kakadu',
              'Alice Springs & Surrounds',
              'Katherine & Surrounds',
              'Uluru/Kata Tjuta Region',
            ],
            'South Australia': [
              'Adelaide',
              'Kangaroo Island',
              'Adelaide Hills',
              'Flinders Rangers & Outback',
            ],
            'Western Australia': ['Perth and Surrounds', 'Broome'],
          }),
        )}
      />
    ));
  