import {Heart, Star, Settings, Home} from 'lucide-react'
import {fn} from 'storybook/test'

import {IconButton} from '../components/atoms/icon-button'

import type {Meta, StoryObj} from '@storybook/react-vite'

const meta = {
  title: 'Atoms/IconButton',
  component: IconButton,
  parameters: {},
  tags: ['autodocs'],
  argTypes: {
    size: {
      control: 'radio',
      options: ['sm', 'default', 'lg'],
    },
    filled: {
      control: 'boolean',
    },
    Icon: {
      control: 'select',
      options: ['Heart', 'Star', 'Settings', 'Home'],
      mapping: {
        Heart,
        Star,
        Settings,
        Home,
      },
    },
  },
  args: {
    onClick: fn(),
    filled: false,
    size: 'default',
    Icon: Heart,
  },
} satisfies Meta<typeof IconButton>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: {
    Icon: Heart,
  },
}

export const Filled: Story = {
  args: {
    Icon: Heart,
    filled: true,
  },
}

export const Small: Story = {
  args: {
    Icon: Star,
    size: 'sm',
  },
}

export const Large: Story = {
  args: {
    Icon: Settings,
    size: 'lg',
  },
}
