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

export interface PrintingState {
    printerName?: string;
}

const initialState: PrintingState = {
    printerName: undefined,
}
export const printingSlice = createSlice({
    name: 'printing',
    initialState,
    reducers: {
        setPrinterName: (state, action: PayloadAction<{ printerName: string }>) => {
            state.printerName = action.payload.printerName;
        }

    }
});

export const {setPrinterName} = printingSlice.actions;
export default printingSlice.reducer;