2024-04-27 20:02:01 +03:00
|
|
|
import { useEffect, useMemo } from "react";
|
2024-04-19 14:34:07 +03:00
|
|
|
import DebugCameraImage from "../camera/DebugCameraImage";
|
|
|
|
|
import { FrigateConfig } from "@/types/frigateConfig";
|
|
|
|
|
import useSWR from "swr";
|
|
|
|
|
import ActivityIndicator from "../indicators/activity-indicator";
|
|
|
|
|
|
|
|
|
|
type ObjectSettingsProps = {
|
|
|
|
|
selectedCamera?: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default function ObjectSettings({
|
|
|
|
|
selectedCamera,
|
|
|
|
|
}: ObjectSettingsProps) {
|
|
|
|
|
const { data: config } = useSWR<FrigateConfig>("config");
|
|
|
|
|
|
|
|
|
|
const cameraConfig = useMemo(() => {
|
|
|
|
|
if (config && selectedCamera) {
|
|
|
|
|
return config.cameras[selectedCamera];
|
|
|
|
|
}
|
|
|
|
|
}, [config, selectedCamera]);
|
|
|
|
|
|
2024-04-27 20:02:01 +03:00
|
|
|
useEffect(() => {
|
|
|
|
|
document.title = "Object Settings - Frigate";
|
|
|
|
|
}, []);
|
|
|
|
|
|
2024-04-19 14:34:07 +03:00
|
|
|
if (!cameraConfig) {
|
|
|
|
|
return <ActivityIndicator />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col h-50">
|
|
|
|
|
<DebugCameraImage cameraConfig={cameraConfig} className="size-full" />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|