import { Story, Meta } from "@storybook/react";

import { InputTimeProps } from "./InputTime";
import Block from "../../atoms/Block";
import InputTime from ".";

export default {
  title: "Component/Elements/InputTime",
  component: InputTime,
  parameters: {
    component: InputTime,
    previewTabs: {
      canvas: {
        hidden: true,
      },
    },
    viewMode: "docs",
  },
} as Meta;

interface ExampleProps {
  children?: React.ReactNode;
  classes: string;
}

const Template: Story<InputTimeProps> = (args) => (
  <Block className="h-[400px]">
    <InputTime {...args}></InputTime>
  </Block>
);

const Example: Story<ExampleProps> = (args) => {
  const classes = args.classes;
  return classes ? (
    <Block className={args.classes}>{args.children}</Block>
  ) : (
    <>{args.children}</>
  );
};

export const Properties = Template.bind({});
Properties.args = {};

export const MaxWidth = Example.bind({});
MaxWidth.args = {
  children: <InputTime />,
  classes: "w-full h-[400px] max-w-xs",
};

export const Variations = Example.bind({});
Variations.args = {
  children: (
    <Block className="flex space-x-6 h-[480px]">
      <InputTime variation="default" />
      <InputTime variation="primary" />
      <InputTime variation="secondary" />
    </Block>
  ),
};
