import { createSlice, PayloadAction } from "@reduxjs/toolkit";

interface AuthState {
    phoneNumber: string | null;
}

const initialState: AuthState = {
    phoneNumber: null,
};

export const authSlice = createSlice({
    name: "authentication",
    initialState,
    reducers: {
        setPhoneNumber: (state, action: PayloadAction<string | null>) => {
            state.phoneNumber = action.payload;
        },
    },
});

export const { setPhoneNumber } = authSlice.actions;

export default authSlice.reducer;
