import { getTimelineItemDescription } from "@/utils/timelineUtil"; import { Button } from "../ui/button"; import Logo from "../Logo"; import { formatUnixTimestampToDateTime } from "@/utils/dateUtil"; import useSWR from "swr"; import { FrigateConfig } from "@/types/frigateConfig"; import VideoPlayer from "../player/VideoPlayer"; import { Card } from "../ui/card"; type TimelineItemCardProps = { timeline: Timeline; relevantPreview: Preview | undefined; onSelect: () => void; }; export default function TimelineItemCard({ timeline, relevantPreview, onSelect, }: TimelineItemCardProps) { const { data: config } = useSWR("config"); return (
{relevantPreview && ( { player.pause(); // autoplay + pause is required for iOS player.currentTime(timeline.timestamp - relevantPreview.start); }} /> )}
{getTimelineItemDescription(timeline)}
{formatUnixTimestampToDateTime(timeline.timestamp, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:%M:%S" : "%I:%M:%S %p", time_style: "medium", date_style: "medium", })}
); }