/**
 * 用于存储联系人与自己创建的卡片信息
 */
import { create } from 'zustand'
import { IContactModel } from '@/types/index'
export interface PageState {
  picked: IContactModel[],
  tmpPicked: IContactModel[],
  setTmpPicked: (tmpPicked: IContactModel[]) => void
  setPicked: (picked: IContactModel[]) => void
  clear: () => void
}

export const usePageStore = create<PageState>((set) => ({
  tmpPicked: [], 
  picked:[],
  setTmpPicked: (tmpPicked) => {
    set({tmpPicked})
  },
  setPicked: (picked) => {
    set({picked})
  },
  clear: () => {
    set({tmpPicked: [], picked: []})
  }
}))
