import { Meta } from "@storybook/react";
import { LoaderProps } from "./LoaderProps";
import Loader from "./Loader";

export default {
  title: "Design System/Indicators/Loader",
  component: Loader,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component:
          'The Loader component is a visual indicator that expresses an indeterminate wait time. It informs users about the status of ongoing processes, such as loading an app, submitting a form, saving updates or fetching data. \n\n```javascript\nimport { Loader } from "@renault-ui-library"\n```',
      },
    },
  },
  argTypes: {
    className: {
      control: { type: "text" },
      description:
        'The Loader component is a visual indicator that expresses an indeterminate wait time. It informs users about the status of ongoing processes, such as loading an app, submitting a form, saving updates or fetching data. \n\n```javascript\nimport { Loader } from "@renault-ui-library"\n```',
    },
    size: {
      control: { type: "select", options: ["small", "medium", "large"] },
      description: "Specifies the size of the Loader.",
    },
    style: {
      control: { type: "object" },
      description: "Sets additional CSS styles to the Loader.",
    },
    themeColor: {
      control: {
        type: "select",
        options: [
          "primary",
          "secondary",
          "tertiary",
          "info",
          "success",
          "warning",
          "error",
          "dark",
          "light",
          "inverse",
        ],
      },
      description: "Specifies the theme color of the Loader.",
    },
    type: {
      control: {
        type: "select",
        options: ["pulsing", "infinite-spinner", "converging-spinner"],
      },
      description: "Specifies the Loader animation type.",
    },
  },
} as Meta;

export const Default = (args: LoaderProps): JSX.Element => <Loader {...args} />;

Default.args = {
  size: "medium",
  themeColor: "primary",
  type: "pulsing",
};
