import docs from "./pn-marketweb-input-docs.json";

export default {
  title: 'Components/Input/Input',
  parameters: {
    notes: docs,
    layout: 'centered',
  },
};

const Template = ({ ...args }) => {
  return `
    <pn-marketweb-input
      type="${args.type}"
      value="${args.value}"
      ></pn-marketweb-input>
  `;
};
export const Primary = Template.bind({});
Primary.args = {
  type: 'text',
};

export const DatetimeLocal = Template.bind({});
DatetimeLocal.args = {
  type: 'datetime-local',
  value: `${new Date().toISOString().split('T')[0]}T${new Date().toISOString().split('T')[1].substring(0, 5)}`,
};

export const Time = Template.bind({});
Time.args = {
  type: 'time',
  value: new Date().toISOString().split('T')[1].substring(0, 5),
};

export const Week = Template.bind({});
Week.args = {
  type: 'week',
};

export const Month = Template.bind({});
Month.args = {
  type: 'month',
};

export const DateInput = Template.bind({});
DateInput.args = {
  type: 'date',
  value: new Date().toISOString().split('T')[0],
};
