import React from 'react';
import { StoryObj, Meta } from '@storybook/react';
import AUSpinnerComponent from '../src/components/AUSpinnerComponent';
import { ThemeWrapper } from './lib/helpers';

export default {
  title: 'Delphinus/Spinner',
  component: AUSpinnerComponent,
  argTypes: {
    init: {
      control: {
        type: 'radio',
      },
      options: [
        '',
        'box',
        'table',
      ],
    },
    className: {
      table: {
        disable: true,
      }
    },
  },
  decorators: [
    (Story, context) => (
      <ThemeWrapper theme={context.globals.theme}>
        {Story()}
      </ThemeWrapper>
    )
  ],
} as Meta<typeof AUSpinnerComponent>;

type Story = StoryObj<typeof AUSpinnerComponent>;

export const Spinner: Story = {
  args: {
    loaded: false,
    height: '20rem',
    init: 'box',
  },
  render: (args) => <AUSpinnerComponent {...args}><p>Child content</p></AUSpinnerComponent>,
};
