mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
prevent console errors for sheet component
This commit is contained in:
parent
7dc2466ba3
commit
334c1c4d95
@ -1,7 +1,19 @@
|
|||||||
import { LogLine } from "@/types/log";
|
import { LogLine } from "@/types/log";
|
||||||
import { isDesktop } from "react-device-detect";
|
import { isDesktop } from "react-device-detect";
|
||||||
import { Sheet, SheetContent } from "../ui/sheet";
|
import {
|
||||||
import { Drawer, DrawerContent } from "../ui/drawer";
|
Sheet,
|
||||||
|
SheetContent,
|
||||||
|
SheetDescription,
|
||||||
|
SheetHeader,
|
||||||
|
SheetTitle,
|
||||||
|
} from "../ui/sheet";
|
||||||
|
import {
|
||||||
|
Drawer,
|
||||||
|
DrawerContent,
|
||||||
|
DrawerDescription,
|
||||||
|
DrawerHeader,
|
||||||
|
DrawerTitle,
|
||||||
|
} from "../ui/drawer";
|
||||||
import { LogChip } from "../indicators/Chip";
|
import { LogChip } from "../indicators/Chip";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
@ -16,6 +28,9 @@ export default function LogInfoDialog({
|
|||||||
}: LogInfoDialogProps) {
|
}: LogInfoDialogProps) {
|
||||||
const Overlay = isDesktop ? Sheet : Drawer;
|
const Overlay = isDesktop ? Sheet : Drawer;
|
||||||
const Content = isDesktop ? SheetContent : DrawerContent;
|
const Content = isDesktop ? SheetContent : DrawerContent;
|
||||||
|
const Header = isDesktop ? SheetHeader : DrawerHeader;
|
||||||
|
const Title = isDesktop ? SheetTitle : DrawerTitle;
|
||||||
|
const Description = isDesktop ? SheetDescription : DrawerDescription;
|
||||||
|
|
||||||
const helpfulLinks = useHelpfulLinks(logLine?.content);
|
const helpfulLinks = useHelpfulLinks(logLine?.content);
|
||||||
|
|
||||||
@ -31,6 +46,10 @@ export default function LogInfoDialog({
|
|||||||
<Content
|
<Content
|
||||||
className={isDesktop ? "" : "max-h-[75dvh] overflow-hidden p-2 pb-4"}
|
className={isDesktop ? "" : "max-h-[75dvh] overflow-hidden p-2 pb-4"}
|
||||||
>
|
>
|
||||||
|
<Header className="sr-only">
|
||||||
|
<Title>Log Details</Title>
|
||||||
|
<Description>Log details</Description>
|
||||||
|
</Header>
|
||||||
{logLine && (
|
{logLine && (
|
||||||
<div className="flex size-full flex-col gap-5">
|
<div className="flex size-full flex-col gap-5">
|
||||||
<div className="flex w-min flex-col gap-1.5">
|
<div className="flex w-min flex-col gap-1.5">
|
||||||
|
|||||||
@ -1,6 +1,18 @@
|
|||||||
import { isDesktop, isIOS, isMobile } from "react-device-detect";
|
import { isDesktop, isIOS, isMobile } from "react-device-detect";
|
||||||
import { Sheet, SheetContent } from "../../ui/sheet";
|
import {
|
||||||
import { Drawer, DrawerContent } from "../../ui/drawer";
|
Sheet,
|
||||||
|
SheetContent,
|
||||||
|
SheetDescription,
|
||||||
|
SheetHeader,
|
||||||
|
SheetTitle,
|
||||||
|
} from "../../ui/sheet";
|
||||||
|
import {
|
||||||
|
Drawer,
|
||||||
|
DrawerContent,
|
||||||
|
DrawerDescription,
|
||||||
|
DrawerHeader,
|
||||||
|
DrawerTitle,
|
||||||
|
} from "../../ui/drawer";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { useFormattedTimestamp } from "@/hooks/use-date-utils";
|
import { useFormattedTimestamp } from "@/hooks/use-date-utils";
|
||||||
@ -66,6 +78,9 @@ export default function ReviewDetailDialog({
|
|||||||
|
|
||||||
const Overlay = isDesktop ? Sheet : Drawer;
|
const Overlay = isDesktop ? Sheet : Drawer;
|
||||||
const Content = isDesktop ? SheetContent : DrawerContent;
|
const Content = isDesktop ? SheetContent : DrawerContent;
|
||||||
|
const Header = isDesktop ? SheetHeader : DrawerHeader;
|
||||||
|
const Title = isDesktop ? SheetTitle : DrawerTitle;
|
||||||
|
const Description = isDesktop ? SheetDescription : DrawerDescription;
|
||||||
|
|
||||||
if (!review) {
|
if (!review) {
|
||||||
return;
|
return;
|
||||||
@ -102,6 +117,10 @@ export default function ReviewDetailDialog({
|
|||||||
: "max-h-[80dvh] overflow-hidden p-2 pb-4",
|
: "max-h-[80dvh] overflow-hidden p-2 pb-4",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
<Header className="sr-only">
|
||||||
|
<Title>Review Item Details</Title>
|
||||||
|
<Description>Review item details</Description>
|
||||||
|
</Header>
|
||||||
{pane == "overview" && (
|
{pane == "overview" && (
|
||||||
<div className="scrollbar-container mt-3 flex size-full flex-col gap-5 overflow-y-auto">
|
<div className="scrollbar-container mt-3 flex size-full flex-col gap-5 overflow-y-auto">
|
||||||
<div className="flex w-full flex-row">
|
<div className="flex w-full flex-row">
|
||||||
|
|||||||
@ -1,6 +1,18 @@
|
|||||||
import { isDesktop, isIOS } from "react-device-detect";
|
import { isDesktop, isIOS } from "react-device-detect";
|
||||||
import { Sheet, SheetContent } from "../../ui/sheet";
|
import {
|
||||||
import { Drawer, DrawerContent } from "../../ui/drawer";
|
Sheet,
|
||||||
|
SheetContent,
|
||||||
|
SheetDescription,
|
||||||
|
SheetHeader,
|
||||||
|
SheetTitle,
|
||||||
|
} from "../../ui/sheet";
|
||||||
|
import {
|
||||||
|
Drawer,
|
||||||
|
DrawerContent,
|
||||||
|
DrawerDescription,
|
||||||
|
DrawerHeader,
|
||||||
|
DrawerTitle,
|
||||||
|
} from "../../ui/drawer";
|
||||||
import { SearchResult } from "@/types/search";
|
import { SearchResult } from "@/types/search";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
@ -71,6 +83,9 @@ export default function SearchDetailDialog({
|
|||||||
|
|
||||||
const Overlay = isDesktop ? Sheet : Drawer;
|
const Overlay = isDesktop ? Sheet : Drawer;
|
||||||
const Content = isDesktop ? SheetContent : DrawerContent;
|
const Content = isDesktop ? SheetContent : DrawerContent;
|
||||||
|
const Header = isDesktop ? SheetHeader : DrawerHeader;
|
||||||
|
const Title = isDesktop ? SheetTitle : DrawerTitle;
|
||||||
|
const Description = isDesktop ? SheetDescription : DrawerDescription;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Overlay
|
<Overlay
|
||||||
@ -86,6 +101,10 @@ export default function SearchDetailDialog({
|
|||||||
isDesktop ? "sm:max-w-xl" : "max-h-[75dvh] overflow-hidden p-2 pb-4"
|
isDesktop ? "sm:max-w-xl" : "max-h-[75dvh] overflow-hidden p-2 pb-4"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
<Header className="sr-only">
|
||||||
|
<Title>Tracked Object Details</Title>
|
||||||
|
<Description>Tracked object details</Description>
|
||||||
|
</Header>
|
||||||
{search && (
|
{search && (
|
||||||
<div className="mt-3 flex size-full flex-col gap-5 md:mt-0">
|
<div className="mt-3 flex size-full flex-col gap-5 md:mt-0">
|
||||||
<div className="flex w-full flex-row">
|
<div className="flex w-full flex-row">
|
||||||
|
|||||||
@ -49,7 +49,7 @@ export default function SearchView({
|
|||||||
onUpdateFilter,
|
onUpdateFilter,
|
||||||
onOpenSearch,
|
onOpenSearch,
|
||||||
}: SearchViewProps) {
|
}: SearchViewProps) {
|
||||||
// remove duplicate review items
|
// remove duplicate event ids
|
||||||
|
|
||||||
const uniqueResults = useMemo(() => {
|
const uniqueResults = useMemo(() => {
|
||||||
return searchResults?.filter(
|
return searchResults?.filter(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user