import LoadingSrc, { LoadingProps } from '@/components/Loading';

export default {
  title: 'components',
  argTypes: {
    status: {
      control: {
        type: 'select',
      },
      options: ['loading', 'ok'],
    },
    type: {
      control: {
        type: 'select',
      },
      options: ['circle', 'dots'],
    },
  },
  args: {
    visible: true,
    background: '',
    spring: false,
    cssStyle: {},
    status: 'loading',
    type: 'circle',
    size: 'default',
  },
};

export const Loading: React.FC<LoadingProps> = ({
  visible,
  background,
  spring,
  cssStyle,
  status,
  type = 'circle',
  size = 'default',
}) => {
  return (
    <LoadingSrc
      visible={visible}
      cssStyle={cssStyle}
      spring={spring}
      background={background}
      type={type}
      status={status}
      size={size}
    />
  );
};
