- Enhanced camera feed state management with region handling and mode changes
This commit is contained in:
@@ -1,38 +1,14 @@
|
||||
import Card from "../../../../ui/Card";
|
||||
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
|
||||
import "react-tabs/style/react-tabs.css";
|
||||
import RegionSelector from "./RegionSelector";
|
||||
import type { PaintedCell, Region } from "../../../../types/types";
|
||||
import type { RefObject } from "react";
|
||||
import CameraPanel from "./CameraPanel";
|
||||
|
||||
type CameraSettingsProps = {
|
||||
regions: Region[];
|
||||
selectedRegionIndex: number;
|
||||
onSelectRegion: (index: number) => void;
|
||||
onChangeRegionColour: (index: number, colour: string) => void;
|
||||
mode: string;
|
||||
onSelectMode: (mode: string) => void;
|
||||
setTabIndex: (tabIndex: number) => void;
|
||||
tabIndex: number;
|
||||
paintedCells: RefObject<Map<string, PaintedCell>>;
|
||||
onAddRegion: () => void;
|
||||
OnRemoveRegion: () => void;
|
||||
};
|
||||
|
||||
const CameraSettings = ({
|
||||
regions,
|
||||
selectedRegionIndex,
|
||||
onSelectRegion,
|
||||
onChangeRegionColour,
|
||||
mode,
|
||||
onSelectMode,
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
paintedCells,
|
||||
onAddRegion,
|
||||
OnRemoveRegion,
|
||||
}: CameraSettingsProps) => {
|
||||
const CameraSettings = ({ tabIndex, setTabIndex }: CameraSettingsProps) => {
|
||||
return (
|
||||
<Card className="p-4 col-span-3 row-span-5 col-start-3 md:col-span-3 md:row-span-5 max-h-screen overflow-auto">
|
||||
<Tabs
|
||||
@@ -41,24 +17,10 @@ const CameraSettings = ({
|
||||
onSelect={(index) => setTabIndex(index)}
|
||||
>
|
||||
<TabList>
|
||||
<Tab>Target Detection</Tab>
|
||||
<Tab>Camera 1</Tab>
|
||||
<Tab>Camera 2</Tab>
|
||||
<Tab>Camera 3</Tab>
|
||||
<Tab>Camera A</Tab>
|
||||
<Tab>Camera B</Tab>
|
||||
<Tab>Camera C</Tab>
|
||||
</TabList>
|
||||
<TabPanel>
|
||||
<RegionSelector
|
||||
regions={regions}
|
||||
selectedRegionIndex={selectedRegionIndex}
|
||||
onSelectRegion={onSelectRegion}
|
||||
onChangeRegionColour={onChangeRegionColour}
|
||||
mode={mode}
|
||||
onSelectMode={onSelectMode}
|
||||
paintedCells={paintedCells}
|
||||
onAddRegion={onAddRegion}
|
||||
OnRemoveRegion={OnRemoveRegion}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<CameraPanel tabIndex={tabIndex} />
|
||||
</TabPanel>
|
||||
|
||||
Reference in New Issue
Block a user