// store/slices/myUserSlice.ts
import { createSlice, PayloadAction } from '@reduxjs/toolkit';

interface UsernameProfile {
  userName: string | null;
  profile: string | null
}

const initialState: UsernameProfile = {
  userName: null,
  profile: null
};

const usernameProfileSlice = createSlice({
  name: 'myUser',
  initialState,
  reducers: {
    setUsernameProfile: (state, action: PayloadAction<string>) => {
      state.userName = action.payload;
      state.profile = action.payload;
    },
  },
});

export const { setUsernameProfile } = usernameProfileSlice.actions;
export default usernameProfileSlice.reducer;
