import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import BackButton from '../components/Ui/backButton/BackButton';
import Icons from '../constants/IconArray.js';

// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
  title: 'UI elements/BackButton',
  component: BackButton,
  // Sets the layout parameter component wide.
  parameters: {
    layout: 'centered',
  },
  // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
  argTypes: {
    size: {defaultValue: 'default', control:{ type:"select", options:["default", "small", "medium", "large"]}},
    icon: { control: {type: 'boolean'} },
    tooltipShow: { control: {type: 'boolean'} },
    variant: {defaultValue: 'default', control:{ type:"select", options:["default", "primary", "secondary"]}},
    iconName: {defaultValue: 'person',control:{type: 'select', options:Icons}}
  },
} as ComponentMeta<typeof BackButton>;

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof BackButton> = (args) => <BackButton {...args} />;

export const BasicBack = Template.bind({});
BasicBack.args = {
  buttonLabel: 'Back',
  icon: true,
  iconName: 'leftArrow'
};

