- Implement parseRTSPUrl function to extract username, password, IP, port, and path from RTSP URLs. - Update CameraSettingFields to utilize parsed RTSP URL data for camera configuration. - Modify WiFiSettingsForm to allow password visibility toggle. - Improve SightingOverview loading and error handling UI. - Adjust NavigationArrow component to reflect updated camera side logic.
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
import { faArrowLeft, faArrowRight } from "@fortawesome/free-solid-svg-icons";
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
import { useNavigate } from "react-router";
|
|
|
|
type NavigationArrowProps = {
|
|
side: string | undefined;
|
|
settingsPage?: boolean;
|
|
};
|
|
|
|
const NavigationArrow = ({ side, settingsPage }: NavigationArrowProps) => {
|
|
const navigate = useNavigate();
|
|
const navigationDest = (side: string | undefined) => {
|
|
if (settingsPage) {
|
|
navigate("/");
|
|
return;
|
|
}
|
|
|
|
if (side === "Front") {
|
|
navigate("/front-camera-settings");
|
|
} else if (side === "Rear") {
|
|
navigate("/Rear-Camera-settings");
|
|
}
|
|
};
|
|
|
|
if (settingsPage) {
|
|
return (
|
|
<>
|
|
{side === "CameraA" ? (
|
|
<FontAwesomeIcon
|
|
icon={faArrowRight}
|
|
className="absolute top-[50%] right-[2%] backdrop-blur-lg hover:cursor-pointer animate-bounce z-30"
|
|
onClick={() => navigationDest(side)}
|
|
/>
|
|
) : (
|
|
<FontAwesomeIcon
|
|
icon={faArrowLeft}
|
|
className="absolute top-[50%] left-[2%] backdrop-blur-md hover:cursor-pointer animate-bounce z-30"
|
|
onClick={() => navigationDest(side)}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
return (
|
|
<>
|
|
<FontAwesomeIcon
|
|
icon={faArrowLeft}
|
|
className="absolute top-[50%] left-[2%] backdrop-blur-md hover:cursor-pointer animate-bounce z-30"
|
|
onClick={() => navigationDest(side)}
|
|
/>
|
|
|
|
<FontAwesomeIcon
|
|
icon={faArrowRight}
|
|
className="absolute top-[50%] right-[2%] backdrop-blur-md hover:cursor-pointer animate-bounce z-30"
|
|
onClick={() => navigationDest(side)}
|
|
/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default NavigationArrow;
|