added sighting feed
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { GB } from "country-flag-icons/react/3x2";
|
||||
import { formatNumberPlate } from "../../utils/utils";
|
||||
import type { SightingType } from "../../types/types";
|
||||
|
||||
type NumberPlateProps = {
|
||||
sighting: SightingType;
|
||||
vrm?: string | undefined;
|
||||
motion?: boolean;
|
||||
};
|
||||
|
||||
const NumberPlate = ({ sighting }: NumberPlateProps) => {
|
||||
const NumberPlate = ({ motion, vrm }: NumberPlateProps) => {
|
||||
return (
|
||||
<div
|
||||
className={`relative w-[8rem] border-4 border-black rounded-lg text-nowrap
|
||||
text-black px-3
|
||||
${sighting?.motion !== "towards" ? "bg-yellow-400" : "bg-white"}
|
||||
${motion ? "bg-yellow-400" : "bg-white"}
|
||||
`}
|
||||
>
|
||||
<div className="">
|
||||
@@ -19,7 +19,7 @@ const NumberPlate = ({ sighting }: NumberPlateProps) => {
|
||||
<GB />
|
||||
</div>
|
||||
<p className=" pl-2 font-extrabold text-right">
|
||||
{formatNumberPlate(sighting?.vrm)}
|
||||
{vrm && formatNumberPlate(vrm)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user