import * as React from 'react';
import {SIZE} from './../../index';
import {Wrapper} from './Wrapper';

import {withInfo} from '@storybook/addon-info';
import {storyLayout} from '../../index.stories';
import {boolean, select, text, withKnobs} from '@storybook/addon-knobs';
import {iconMap, sizeMap} from '../../utils/storybookEnums';


// eslint-disable-next-line no-restricted-syntax
export default {
    title: 'Wrapper',
    decorators: [withInfo, withKnobs, storyLayout]
};

export const wrapper = () => {
    return (
        <Wrapper
            prefix={select('prefix', iconMap(false), 'puzzle')}
            suffix={select('suffix', iconMap(false), 'search')}
            size={select('size', sizeMap(true), SIZE.MIDDLE)}
            isReadOnly={boolean('readOnly', false)}
            isDisabled={boolean('isDisabled', false)}
            hasError={boolean('hasError', false)}
            errorMessage={text('errorMessage', 'Simple Error')}
        >
            <div>hello</div>
        </Wrapper>
    );
};
