diff --git a/web/src/components/settings/PolygonItem.tsx b/web/src/components/settings/PolygonItem.tsx index b0b402064..9d8972341 100644 --- a/web/src/components/settings/PolygonItem.tsx +++ b/web/src/components/settings/PolygonItem.tsx @@ -33,6 +33,7 @@ import { toast } from "sonner"; import useSWR from "swr"; import { FrigateConfig } from "@/types/frigateConfig"; import { reviewQueries } from "@/utils/zoneEdutUtil"; +import IconWrapper from "../ui/icon-wrapper"; type PolygonItemProps = { polygon: Polygon; @@ -285,55 +286,46 @@ export default function PolygonItem({ )} {!isMobile && hoveredPolygonIndex === index && (
-
{ - setActivePolygonIndex(index); - setEditPane(polygon.type); - }} - > - - - - - Edit - -
-
handleCopyCoordinates(index)} - > - - - - - Copy coordinates - -
-
!isLoading && setDeleteDialogOpen(true)} - > - - - - - Delete - -
+ + + { + setActivePolygonIndex(index); + setEditPane(polygon.type); + }} + /> + + Edit + + + + + handleCopyCoordinates(index)} + /> + + Copy coordinates + + + + + !isLoading && setDeleteDialogOpen(true)} + /> + + Delete +
)} diff --git a/web/src/components/ui/icon-wrapper.tsx b/web/src/components/ui/icon-wrapper.tsx new file mode 100644 index 000000000..f87d18c62 --- /dev/null +++ b/web/src/components/ui/icon-wrapper.tsx @@ -0,0 +1,21 @@ +import { ForwardedRef, forwardRef } from "react"; +import { IconType } from "react-icons"; + +interface IconWrapperProps { + icon: IconType; + className?: string; + [key: string]: any; +} + +const IconWrapper = forwardRef( + ( + { icon: Icon, className, ...props }: IconWrapperProps, + ref: ForwardedRef, + ) => ( +
+ +
+ ), +); + +export default IconWrapper;