{t("trackingDetails.scrollViewTips")}
{t("trackingDetails.count", {
- first: selectedIndex + 1,
+ first: eventSequence?.length ?? 0,
second: eventSequence?.length ?? 0,
})}
@@ -624,7 +394,14 @@ export default function TrackingDetails({
showZones={showZones}
setShowZones={setShowZones}
annotationOffset={annotationOffset}
- setAnnotationOffset={setAnnotationOffset}
+ setAnnotationOffset={(value) => {
+ if (typeof value === "function") {
+ const newValue = value(annotationOffset);
+ setAnnotationOffset(newValue);
+ } else {
+ setAnnotationOffset(value);
+ }
+ }}
/>
)}
@@ -639,7 +416,7 @@ export default function TrackingDetails({
className="flex items-center gap-2 font-medium"
onClick={(e) => {
e.stopPropagation();
- setTimeIndex(event.start_time ?? 0);
+ handleSeekToTime(event.start_time ?? 0);
}}
role="button"
>
@@ -685,15 +462,17 @@ export default function TrackingDetails({
) : (
-
+ {isWithinEventRange && (
+
+ )}
{eventSequence.map((item, idx) => {
const isActive =
Math.abs(
- (propTimeIndex ?? 0) - (item.timestamp ?? 0),
+ (effectiveTime ?? 0) - (item.timestamp ?? 0),
) <= 0.5;
const formattedEventTimestamp = config
? formatUnixTimestampToDateTime(item.timestamp ?? 0, {
@@ -747,16 +526,8 @@ export default function TrackingDetails({
ratio={ratio}
areaPx={areaPx}
areaPct={areaPct}
- onClick={() => {
- setTimeIndex(item.timestamp ?? 0);
- handleSetBox(
- item.data.box ?? [],
- item.data.attribute_box,
- );
- setLifecycleZones(item.data.zones);
- setSelectedZone("");
- }}
- setSelectedZone={setSelectedZone}
+ onClick={() => handleLifecycleClick(item)}
+ setSelectedZone={_setSelectedZone}
getZoneColor={getZoneColor}
/>
);
@@ -784,28 +555,27 @@ export function LifecycleIcon({
}: GetTimelineIconParams) {
switch (lifecycleItem.class_type) {
case "visible":
- return ;
+ return ;
case "gone":
- return ;
+ return ;
case "active":
- return ;
+ return ;
case "stationary":
- return ;
+ return ;
case "entered_zone":
- return ;
+ return ;
case "attribute":
- switch (lifecycleItem.data?.attribute) {
- case "face":
- return ;
- case "license_plate":
- return ;
- default:
- return ;
- }
+ return lifecycleItem.data.attribute === "face" ? (
+
+ ) : lifecycleItem.data.attribute === "license_plate" ? (
+
+ ) : (
+
+ );
case "heard":
- return ;
+ return ;
case "external":
- return ;
+ return ;
default:
return null;
}