import React from 'react';
import { storiesOf } from '@storybook/react';
import AmountSelection from './index';
import { State, Store } from '@sambego/storybook-state';
import { t } from 'Framework/i18n';

const store = new Store({
    note: '100',
    focusedInput: false,
});

function handleChange(event) {
    store.set({ note: event.target.value });
}

storiesOf('AmountSelection', module).add('with active Input', () => (
    <State store={store}>
        {state => (
            <AmountSelection
                value={state.note}
                onChange={handleChange}
                amountLabel={t('amountPrice.amount')}
            />
        )}
    </State>
));
