2025-08-15 09:32:33 +01:00
|
|
|
import type { IconProp } from "@fortawesome/fontawesome-svg-core";
|
2025-08-13 14:23:48 +01:00
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
|
import clsx from "clsx";
|
2025-09-23 13:03:54 +01:00
|
|
|
import NumberPlate from "../PlateStack/NumberPlate";
|
|
|
|
|
import type { SightingType } from "../../types/types";
|
2025-08-13 14:23:48 +01:00
|
|
|
|
|
|
|
|
type CameraOverviewHeaderProps = {
|
2025-09-26 11:42:12 +01:00
|
|
|
title?: string;
|
2025-08-18 12:53:30 +01:00
|
|
|
icon?: IconProp;
|
2025-09-08 15:21:17 +01:00
|
|
|
img?: string;
|
2025-09-23 13:03:54 +01:00
|
|
|
sighting?: SightingType | null;
|
2025-08-13 14:23:48 +01:00
|
|
|
};
|
|
|
|
|
|
2025-10-29 15:04:40 +00:00
|
|
|
const CardHeader = ({ title, icon, img, sighting }: CameraOverviewHeaderProps) => {
|
2025-08-13 14:23:48 +01:00
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className={clsx(
|
2025-10-29 15:04:40 +00:00
|
|
|
"w-full border-b border-gray-600 flex flex-row items-center space-x-2 mb-6 relative justify-between"
|
2025-08-13 14:23:48 +01:00
|
|
|
)}
|
|
|
|
|
>
|
2025-09-08 15:21:17 +01:00
|
|
|
<div className="flex items-center space-x-2">
|
|
|
|
|
{icon && <FontAwesomeIcon icon={icon} className="size-4" />}
|
|
|
|
|
<h2 className="text-xl">{title}</h2>
|
|
|
|
|
</div>
|
2025-10-29 15:04:40 +00:00
|
|
|
{img && <img src={img} alt="Logo" width={100} height={50} className="ml-auto" />}
|
2025-09-23 13:03:54 +01:00
|
|
|
{sighting?.vrm && <NumberPlate vrm={sighting.vrm} motion={false} />}
|
2025-08-13 14:23:48 +01:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-15 09:32:33 +01:00
|
|
|
export default CardHeader;
|