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

import { DocsTemplate } from '../../../../.storybook'
import DownloadLoader from './DownloadLoader'

export default {
  title: 'Components/Loaders/DownloadLoader',
  component: DownloadLoader,
  parameters: {
    docs: {
      page: () => (
        <DocsTemplate
          description={
            <span>
              The <code>DownloadLoader</code> displays a rotating icon to
              indicate a loading state, with options for custom icons and
              styling.
            </span>
          }
        />
      ),
    },
  },
} as Meta<typeof DownloadLoader>

type Story = StoryObj<typeof DownloadLoader>

const Template: Story = {
  render: (args) => {
    return <DownloadLoader {...args} />
  },
}

export const Basic: Story = {
  ...Template,
  args: {},
}

export const CustomIcon: Story = {
  ...Template,
  args: {
    customIcon: 'info',
  },
}
