import { create } from 'zustand'

interface SelectionStore {
  selectedPbiId: string | null
  selectedStoryId: string | null
  selectPbi: (id: string | null) => void
  selectStory: (id: string | null) => void
  clearSelection: () => void
}

export const useSelectionStore = create<SelectionStore>((set) => ({
  selectedPbiId: null,
  selectedStoryId: null,
  selectPbi: (id) => set({ selectedPbiId: id, selectedStoryId: null }),
  selectStory: (id) => set({ selectedStoryId: id }),
  clearSelection: () => set({ selectedPbiId: null, selectedStoryId: null }),
}))
