Files
Mav-Mobile-UI/src/components/SightingModal/SightingModal.tsx

50 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-09-12 13:28:14 +01:00
import type { SightingType } from "../../types/types";
2025-09-12 08:21:52 +01:00
import NumberPlate from "../PlateStack/NumberPlate";
import ModalComponent from "../UI/ModalComponent";
type SightingModalProps = {
isSightingModalOpen: boolean;
handleClose: () => void;
2025-09-12 13:28:14 +01:00
sighting: SightingType | null;
2025-09-12 08:21:52 +01:00
};
const SightingModal = ({
isSightingModalOpen,
handleClose,
sighting,
}: SightingModalProps) => {
const motionAway = (sighting?.motion ?? "").toUpperCase() === "AWAY";
2025-09-15 10:27:31 +01:00
console.log(sighting);
2025-09-12 08:21:52 +01:00
return (
<ModalComponent isModalOpen={isSightingModalOpen} close={handleClose}>
2025-09-12 13:28:14 +01:00
<div>
<h2>Sighting Details</h2>
</div>
2025-09-12 08:21:52 +01:00
<button onClick={handleClose}>close</button>
<div>
2025-09-12 13:28:14 +01:00
<div>
<NumberPlate vrm={sighting?.vrm} motion={motionAway} />
</div>
<div>
<img
src={sighting?.overviewUrl}
alt="overview patch"
className="h-[50%] w-[50%]"
/>
</div>
<div>
<img src={sighting?.plateUrlColour} alt="plate patch" height={48} />
<img
src={sighting?.plateUrlInfrared}
height={48}
alt="infrared patch"
className={"opacity-60"}
/>
</div>
2025-09-12 08:21:52 +01:00
</div>
</ModalComponent>
);
};
export default SightingModal;