- Implemented ModalComponent for reusable modal functionality. - Created SightingItemModal to manage modal state and display sighting details. - Developed SightingModalContent to render sighting information including video feed and metadata.
24 lines
542 B
TypeScript
24 lines
542 B
TypeScript
import type { CameraSettings, CameraSettingsAction } from "../../utils/types";
|
|
|
|
export const initialState: CameraSettings = {
|
|
mode: 0,
|
|
imageSize: { width: 1280, height: 960 },
|
|
};
|
|
|
|
export const cameraSettingsReducer = (state: CameraSettings, action: CameraSettingsAction) => {
|
|
switch (action.type) {
|
|
case "SET_MODE":
|
|
return {
|
|
...state,
|
|
mode: action.payload,
|
|
};
|
|
case "SET_IMAGE_SIZE":
|
|
return {
|
|
...state,
|
|
imageSize: action.payload,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|