import { defineStore } from "pinia";

export interface SelectedDateState {
  startDate: string;
  endDate: string;
  totalDays: number;
}

export const useSelectedDateStore = defineStore("selectedDate", {
  state() {
    return {
      selectedDate: {
        startDate: "",
        endDate: "",
        totalDays: 1,
      } as SelectedDateState,
    };
  },

  actions: {
    setData(data: SelectedDateState) {
      this.selectedDate = data;
    },
  },

  unistorage: true,
});
