blob: b3d787f42fd1868d8fc9a4a177022681e74482fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import React from "react";
import { useStore, isValidCameraView } from "../store/store.ts";
export const CameraSelector: React.FC = () => {
const cameraView = useStore((state) => state.cameraView);
const setCameraView = useStore((state) => state.setCameraView);
const handleChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
const value = event.target.value;
if (isValidCameraView(value)) {
setCameraView(value);
}
};
return (
<div className="camera-selector-wrapper">
<select
className="camera-selector"
value={cameraView}
onChange={handleChange}
>
<option value="perspective">Perspective</option>
<option value="ortho-top">Top (Ortho)</option>
<option value="ortho-front">Front (Ortho)</option>
<option value="ortho-side">Side (Ortho)</option>
</select>
</div>
);
};
|