import type { OrderData } from "@hooks/apis/auto/useAutoHistory";
import { createSlice } from "@reduxjs/toolkit";

const initialState: InflightParams = {
	data: null,
};

const inflightSlice = createSlice({
	name: "inflight",
	initialState,
	reducers: {
		setInflightData: (state, action: { payload: InflightParams }) => {
			state.data = action.payload.data;
		},
	},
});

export interface InflightParams {
	data: OrderData | null;
}

export const { setInflightData } = inflightSlice.actions;
export default inflightSlice.reducer;
