import type { RoomContextActionType } from "../types/room-action"; import type { RoomContextReducerType } from "../types/room-reduce"; export function RoomContextReducer( state: RoomContextReducerType, action: RoomContextActionType, ): RoomContextReducerType { switch (action.type) { case "set-room-select": return { ...state, selectedRooms: action.payload.selectedRooms, activeTab: action.payload.activeTab, roomCount: action.payload.roomCount, }; default: return { ...state, }; } }