import type {Meta, StoryObj} from '@storybook/angular';
import {MainButton} from './main-button';
import {moduleMetadata} from '@storybook/angular';
import {CommonModule} from '@angular/common';

// More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction
const meta: Meta<MainButton> = {
  title: 'UI/Buttons/MainButton',
  component: MainButton,
  tags: ['autodocs'],
  decorators: [
    moduleMetadata({
      imports: [CommonModule],
      providers: []
    })
  ],
  argTypes: {
    label: {control: 'text'},
    icon: {control: 'text'},
    kind: {
      control: 'select',
      options: ['', 'primary', 'secondary', 'info', 'success', 'warning', 'danger'],
      description: 'Style du bouton'
    },
  },
};

export default meta;
type Story = StoryObj<MainButton>;

// More on writing stories with args: https://storybook.js.org/docs/angular/writing-stories/args
export const Primary: Story = {
  args: {
    label: 'Button',
    icon: 'home-line-2',
    kind: 'primary'
  },
};

export const Secondary: Story = {
  args: {
    label: 'Secondary Button',
    icon: 'settings-line',
    kind: 'secondary'
  },
};

export const Info: Story = {
  args: {
    label: 'Info Button',
    icon: 'information-line',
    kind: 'info'
  },
};

export const Success: Story = {
  args: {
    label: 'Success Button',
    icon: 'check-line',
    kind: 'success'
  },
};

export const Warning: Story = {
  args: {
    label: 'Warning Button',
    icon: 'alert-line',
    kind: 'warning'
  },
};

export const Danger: Story = {
  args: {
    label: 'Danger Button',
    icon: 'close-circle-line',
    kind: 'danger'
  },
};

export const WithoutIcon: Story = {
  args: {
    label: 'Button without icon',
    icon: '',
    kind: 'primary'
  },
};

export const WithIcon: Story = {
  args: {
    label: 'Button with icon',
    icon: 'user-line',
    kind: ''
  },
};
