import { Meta, Story } from '@storybook/react';
import React from 'react';
import { RPGUIRoot } from '../../../components/RPGUI/RPGUIRoot';
import {
  IRadioInput,
  RadioInput,
} from '../../../components/RadioInput/RadioInput';
import { Itools } from '../../../components/RadioInput/instruments';

const meta: Meta = {
  title: 'UI/Buttons & Inputs/Radio Input',
  component: RadioInput,
};

export default meta;
const Template: Story<IRadioInput> = args => (
  <RPGUIRoot>
    <RadioInput {...args} />
  </RPGUIRoot>
);

export const RadioInputElement = Template.bind({});

const onSelectIt = (value: string): void => {
  console.log('Story package', value);
};

const onClose = () => {
  console.log('close');
};

RadioInputElement.args = {
  title: 'Harvesting instruments',
  subtitle: 'Use the tool, you need it',
  onSelect: onSelectIt,
  onCancel: onClose,
  items: Itools,
};
