// stores/publicRelation.ts
import { defineStore } from 'pinia'
import type { PRCard } from '~/composables/interface/PRTypes'

export const usePublicRelationStore = defineStore('publicRelation', {
  state: () => ({
    items: [] as PRCard[],
    loaded: false
  }),

  actions: {
    setItems(prCards: PRCard[]) {
      this.items = prCards
      this.loaded = true
    },
    getById(id: number) {
      return this.items.find(i => i.id === id)
    },
  }
})
