mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
fix typing
This commit is contained in:
parent
275dfe017e
commit
435aab09be
@ -9,9 +9,8 @@ import {
|
||||
} from "react";
|
||||
import MotionSegment from "./MotionSegment";
|
||||
import { useEventUtils } from "@/hooks/use-event-utils";
|
||||
import { ReviewSegment, ReviewSeverity } from "@/types/review";
|
||||
import { MotionData, ReviewSegment, ReviewSeverity } from "@/types/review";
|
||||
import ReviewTimeline from "./ReviewTimeline";
|
||||
import { MockMotionData } from "@/pages/UIPlayground";
|
||||
|
||||
export type MotionReviewTimelineProps = {
|
||||
segmentDuration: number;
|
||||
@ -25,7 +24,7 @@ export type MotionReviewTimelineProps = {
|
||||
minimapStartTime?: number;
|
||||
minimapEndTime?: number;
|
||||
events: ReviewSegment[];
|
||||
motion_events: MockMotionData[];
|
||||
motion_events: MotionData[];
|
||||
severityType: ReviewSeverity;
|
||||
contentRef: RefObject<HTMLDivElement>;
|
||||
onHandlebarDraggingChange?: (isDragging: boolean) => void;
|
||||
|
||||
@ -4,7 +4,12 @@ import useSWR from "swr";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||
import EventReviewTimeline from "@/components/timeline/EventReviewTimeline";
|
||||
import { ReviewData, ReviewSegment, ReviewSeverity } from "@/types/review";
|
||||
import {
|
||||
MotionData,
|
||||
ReviewData,
|
||||
ReviewSegment,
|
||||
ReviewSeverity,
|
||||
} from "@/types/review";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import CameraActivityIndicator from "@/components/indicators/CameraActivityIndicator";
|
||||
import MotionReviewTimeline from "@/components/timeline/MotionReviewTimeline";
|
||||
@ -53,14 +58,7 @@ function ColorSwatch({ name, value }: { name: string; value: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
export type MockMotionData = {
|
||||
start_time: number;
|
||||
end_time: number;
|
||||
motionValue: number;
|
||||
audioValue: number;
|
||||
};
|
||||
|
||||
function generateRandomMotionAudioData(): MockMotionData[] {
|
||||
function generateRandomMotionAudioData(): MotionData[] {
|
||||
const now = new Date();
|
||||
const endTime = now.getTime() / 1000;
|
||||
const startTime = endTime - 24 * 60 * 60; // 24 hours ago
|
||||
@ -72,14 +70,12 @@ function generateRandomMotionAudioData(): MockMotionData[] {
|
||||
startTimestamp < endTime;
|
||||
startTimestamp += interval
|
||||
) {
|
||||
const endTimestamp = startTimestamp + interval;
|
||||
const motionValue = Math.floor(Math.random() * 101); // Random number between 0 and 100
|
||||
const audioValue = Math.random() * -100; // Random negative value between -100 and 0
|
||||
const motion = Math.floor(Math.random() * 101); // Random number between 0 and 100
|
||||
const audio = Math.random() * -100; // Random negative value between -100 and 0
|
||||
data.push({
|
||||
start_time: startTimestamp,
|
||||
end_time: endTimestamp,
|
||||
motionValue,
|
||||
audioValue,
|
||||
motion,
|
||||
audio,
|
||||
});
|
||||
}
|
||||
|
||||
@ -126,7 +122,7 @@ function UIPlayground() {
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
const contentRef = useRef<HTMLDivElement>(null);
|
||||
const [mockEvents, setMockEvents] = useState<ReviewSegment[]>([]);
|
||||
const [mockMotionData, setMockMotionData] = useState<MockMotionData[]>([]);
|
||||
const [mockMotionData, setMockMotionData] = useState<MotionData[]>([]);
|
||||
const [handlebarTime, setHandlebarTime] = useState(
|
||||
Math.floor(Date.now() / 1000) - 15 * 60,
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user