{monoviews}
@@ -213,45 +233,36 @@ interface MonoviewProps {
cameras: Camera[];
cameraIndex: number | null;
onSelect: (cameraIndex: number | null) => void;
- renderCamera: (camera: Camera) => JSX.Element;
+ renderCamera: (camera: Camera | null, chooser: JSX.Element) => JSX.Element;
}
/** A single pane of a Multiview, including its camera chooser. */
const Monoview = (props: MonoviewProps) => {
- return (
-
-
-
-
- {props.cameraIndex !== null &&
- props.renderCamera(props.cameras[props.cameraIndex])}
-
+ const chooser = (
+
+ );
+ return props.renderCamera(
+ props.cameraIndex === null ? null : props.cameras[props.cameraIndex],
+ chooser
);
};
diff --git a/ui/src/Live/index.tsx b/ui/src/Live/index.tsx
index 9bcb4e8..03f04b4 100644
--- a/ui/src/Live/index.tsx
+++ b/ui/src/Live/index.tsx
@@ -16,7 +16,9 @@ const Live = ({ cameras, layoutIndex }: LiveProps) => {
}
+ renderCamera={(camera: Camera | null, chooser: JSX.Element) => (
+
+ )}
/>
);
};