2025-11-27 11:43:10 +00:00
|
|
|
import type { CameraFeedAction, CameraFeedState, PaintedCell } from "../../types/types";
|
2025-11-27 10:43:56 +00:00
|
|
|
|
|
|
|
|
export const initialState: CameraFeedState = {
|
|
|
|
|
cameraFeedID: "A",
|
2025-11-27 11:43:10 +00:00
|
|
|
paintedCells: {
|
|
|
|
|
A: new Map<string, PaintedCell>(),
|
|
|
|
|
B: new Map<string, PaintedCell>(),
|
|
|
|
|
C: new Map<string, PaintedCell>(),
|
|
|
|
|
},
|
2025-11-27 10:43:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function reducer(state: CameraFeedState, action: CameraFeedAction) {
|
|
|
|
|
switch (action.type) {
|
|
|
|
|
case "SET_CAMERA_FEED":
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
cameraFeedID: action.payload,
|
|
|
|
|
};
|
|
|
|
|
default:
|
|
|
|
|
return state;
|
|
|
|
|
}
|
|
|
|
|
}
|