import { Meta, StoryObj } from '@storybook/angular';
import { DateRangeValue, RangeDatepickerComponent } from '@isa/ui/datepicker';

interface DatepickerComponentInputs {
  value: DateRangeValue;
  min: Date;
  max: Date;
}

const meta: Meta<RangeDatepickerComponent> = {
  title: 'ui/datepicker/Datepicker',
  component: RangeDatepickerComponent,
  argTypes: {
    value: { control: 'object' },
    min: { control: 'date' },
    max: { control: 'date' },
  },
  args: {
    value: undefined,
    min: new Date(2022, 0, 1),
    max: new Date(2026, 11, 31),
  },
};

export default meta;

type Story = StoryObj<DatepickerComponentInputs>;

export const Default: Story = {
  args: {
    value: [new Date(), new Date(Date.now() + 5 * 24 * 60 * 60 * 1000)], // Start: today, End: 5 days after today
  },
};
