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

39 lines
1.0 KiB
TypeScript
Raw Normal View History

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";
import NumberPlate from "../PlateStack/NumberPlate";
import type { SightingType } from "../../types/types";
2025-08-13 14:23:48 +01:00
type CameraOverviewHeaderProps = {
title?: string;
2025-08-18 12:53:30 +01:00
icon?: IconProp;
img?: string;
sighting?: SightingType | null;
2025-08-13 14:23:48 +01:00
};
const CardHeader = ({
title,
icon,
img,
sighting,
}: CameraOverviewHeaderProps) => {
2025-08-13 14:23:48 +01:00
return (
<div
className={clsx(
"w-full border-b border-gray-600 flex flex-row items-center space-x-2 md:mb-6 relative justify-between"
2025-08-13 14:23:48 +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-09-10 09:09:23 +01:00
{img && (
<img src={img} alt="Logo" width={100} height={50} className="ml-auto" />
)}
{sighting?.vrm && <NumberPlate vrm={sighting.vrm} motion={false} />}
2025-08-13 14:23:48 +01:00
</div>
);
};
export default CardHeader;