import { Modal } from "./Modal";
import { SeatSelectForm } from "../../Form/SeatSelectForm/SeatSelectForm";
// import { action } from 'storybook/actions';
export default {
  title: "Base/Modal",
  component: Modal,
  argTypes: {
    title: { control: "text" },
  },
};

const availableSeats=7;
  const seatOptions = Array.from({ length: availableSeats }).map((_, i) => ({
    value: i + 1,
    label: `${i + 1} ${i + 1 === 1 ? "seat" : "seats"}`,
  }));
  const seatCount=1;
export const Default = {
  args:{
    title:"choose the Number of seats",
    onClose:() => console.log("Modal closed"),
    children:(availableSeats > 0 ? (
          <SeatSelectForm
            seatOptions={seatOptions}
            seatCount={seatCount}
          />
        ) : (
          <p>No seats available</p>
        ))
  },
};
