2025-08-15 09:32:33 +01:00
|
|
|
import { faArrowLeft, faArrowRight } from "@fortawesome/free-solid-svg-icons";
|
|
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
|
import { useNavigate } from "react-router";
|
|
|
|
|
|
|
|
|
|
type NavigationArrowProps = {
|
2025-09-25 10:38:49 +01:00
|
|
|
side: string | undefined;
|
2025-08-18 12:53:30 +01:00
|
|
|
settingsPage?: boolean;
|
2025-08-15 09:32:33 +01:00
|
|
|
};
|
|
|
|
|
|
2025-08-18 12:53:30 +01:00
|
|
|
const NavigationArrow = ({ side, settingsPage }: NavigationArrowProps) => {
|
2025-08-15 09:32:33 +01:00
|
|
|
const navigate = useNavigate();
|
2025-09-25 10:38:49 +01:00
|
|
|
const navigationDest = (side: string | undefined) => {
|
2025-08-18 12:53:30 +01:00
|
|
|
if (settingsPage) {
|
2025-08-15 09:32:33 +01:00
|
|
|
navigate("/");
|
2025-08-18 12:53:30 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-22 10:38:28 +01:00
|
|
|
if (side === "Front") {
|
2025-08-18 12:53:30 +01:00
|
|
|
navigate("/front-camera-settings");
|
2025-08-22 10:38:28 +01:00
|
|
|
} else if (side === "Rear") {
|
2025-08-15 09:32:33 +01:00
|
|
|
navigate("/Rear-Camera-settings");
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-08-18 12:53:30 +01:00
|
|
|
|
|
|
|
|
if (settingsPage) {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2025-09-09 15:57:35 +01:00
|
|
|
{side === "CameraFront" ? (
|
2025-08-18 12:53:30 +01:00
|
|
|
<FontAwesomeIcon
|
|
|
|
|
icon={faArrowRight}
|
2025-09-12 13:28:14 +01:00
|
|
|
className="absolute top-[50%] right-[2%] backdrop-blur-lg hover:cursor-pointer animate-bounce z-30"
|
2025-08-18 12:53:30 +01:00
|
|
|
onClick={() => navigationDest(side)}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<FontAwesomeIcon
|
|
|
|
|
icon={faArrowLeft}
|
2025-09-12 08:21:52 +01:00
|
|
|
className="absolute top-[50%] left-[2%] backdrop-blur-md hover:cursor-pointer animate-bounce z-30"
|
2025-08-18 12:53:30 +01:00
|
|
|
onClick={() => navigationDest(side)}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-08-15 09:32:33 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
2025-09-30 09:07:22 +01:00
|
|
|
<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)}
|
|
|
|
|
/>
|
2025-08-15 09:32:33 +01:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default NavigationArrow;
|