mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
get layout going
This commit is contained in:
parent
bfeda4224e
commit
c3ca8ebf2c
@ -1,6 +1,9 @@
|
|||||||
import PreviewThumbnailPlayer from "../player/PreviewThumbnailPlayer";
|
import { getTimelineItemDescription } from "@/utils/timelineUtil";
|
||||||
import { AspectRatio } from "../ui/aspect-ratio";
|
import { Button } from "../ui/button";
|
||||||
import { Card, CardContent } from "../ui/card";
|
import Logo from "../Logo";
|
||||||
|
import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
|
||||||
|
import useSWR from "swr";
|
||||||
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
|
|
||||||
type TimelineItemCardProps = {
|
type TimelineItemCardProps = {
|
||||||
timeline: Timeline;
|
timeline: Timeline;
|
||||||
@ -10,23 +13,34 @@ export default function TimelineItemCard({
|
|||||||
timeline,
|
timeline,
|
||||||
relevantPreview,
|
relevantPreview,
|
||||||
}: TimelineItemCardProps) {
|
}: TimelineItemCardProps) {
|
||||||
|
const { data: config } = useSWR<FrigateConfig>("config");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="bg-red-500">
|
<div className="relative m-2 flex h-24">
|
||||||
<div className="flex justify-between h-24">
|
<div className="w-1/2 bg-black"></div>
|
||||||
<div className="w-1/2">
|
<div className="px-1 w-1/2">
|
||||||
<PreviewThumbnailPlayer
|
<div className="capitalize font-semibold text-sm">
|
||||||
camera={timeline.camera}
|
{getTimelineItemDescription(timeline)}
|
||||||
relevantPreview={relevantPreview}
|
|
||||||
startTs={timeline.timestamp}
|
|
||||||
eventId={timeline.source_id}
|
|
||||||
isMobile={false}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className="text-sm">
|
||||||
<div>{timeline.camera}</div>
|
{formatUnixTimestampToDateTime(timeline.timestamp, {
|
||||||
<div>{timeline.data.label}</div>
|
strftime_fmt:
|
||||||
|
config?.ui.time_format == "24hour" ? "%H:%M:%S" : "%I:%M:%S %p",
|
||||||
|
time_style: "medium",
|
||||||
|
date_style: "medium",
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
className="absolute bottom-0 right-0"
|
||||||
|
size="sm"
|
||||||
|
variant="secondary"
|
||||||
|
>
|
||||||
|
<div className="w-8 h-8">
|
||||||
|
<Logo />
|
||||||
|
</div>
|
||||||
|
+
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user