import { create } from 'zustand' // Caller ID (plan step 3.5): the call on screen and the calls seen in this session. A call is // the server's `call_incoming` payload: { call_id, at, number, ext, customer | null }. const usePhoneStore = create((set) => ({ activeCall: null, log: [], // last 20 calls setActiveCall: (call) => set({ activeCall: call }), dismissCall: () => set({ activeCall: null }), addCallToLog: (entry) => set(s => ({ log: [entry, ...s.log.filter(c => c.call_id !== entry.call_id)].slice(0, 20) })), })) export default usePhoneStore