import { defineStore } from 'pinia';
import { getApp, getNum } from '/@/hooks/userApp';

export interface TourState {
  toursList: any[];
  sourceList: Nullable<any[]>;
  frameId: number;
  partId: number;
  tours: any[];
  musicList: any[];
  delList: any[];
  isPlay: boolean;
  showTours: boolean;
}

export const useTourStore = defineStore({
  id: 'tour',
  state: (): TourState => ({
    toursList: [],
    sourceList: null,
    frameId: 0,
    partId: 0,
    tours: [],
    musicList: [],
    delList: [],
    isPlay: false,
    showTours: false,
  }),
  getters: {},
  actions: {
    async delTours(): Promise<void> {
      const app = getApp();
      const res = await app.remote_editor.tour_delete({ num: getNum() });
      console.log('res', res);
    },
    async delFile(): Promise<void> {},
    setData(toursList): void {
      this.toursList = toursList;
    },
  },
});
