import { create } from "zustand";

type Household = {
  id: string;
  name: string;
};

type HouseholdState = {
  currentHousehold: Household | null;
  households: Household[];
  setCurrentHousehold: (household: Household | null) => void;
  setHouseholds: (households: Household[]) => void;
};

export const useHouseholdStore = create<HouseholdState>((set) => ({
  currentHousehold: null,
  households: [],
  setCurrentHousehold: (currentHousehold) => set({ currentHousehold }),
  setHouseholds: (households) => set({ households }),
}));
