// src/store/fcmSlice.js
import { createSlice } from '@reduxjs/toolkit';

const fcmSlice = createSlice({
  name: 'fcm',
  initialState: {
    permission: null,
    token: null
  },
  reducers: {
    setFcmToken(state, action) {
      state.token = action.payload;
    },
    clearFcmToken(state) {
      state.token = null;
    },
    setFcmPermission(state, action) {
      state.permission = action.payload;
    }
  }
});

export const { setFcmToken, clearFcmToken, setFcmPermission } = fcmSlice.actions;
export default fcmSlice.reducer;
