import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { RootState } from '../store';

interface HeaderState {
  showInput: boolean;
}

const initialState: HeaderState = {
  showInput: false,
};

const headerSlice = createSlice({
  name: 'header',
  initialState,
  reducers: {
    setShowInput(state, action: PayloadAction<boolean>) {
      state.showInput = action.payload;
    },
  },
});

export const selectHeader = (state: RootState) => state.headerSlice;

export const { setShowInput } = headerSlice.actions;

export default headerSlice.reducer;
