mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
clean up
This commit is contained in:
parent
0cd12d2c38
commit
028c32051d
@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
import { useApiHost } from "@/api";
|
import { useApiHost } from "@/api";
|
||||||
import { getIconForLabel } from "@/utils/iconUtil";
|
import { getIconForLabel } from "@/utils/iconUtil";
|
||||||
import TimeAgo from "../dynamic/TimeAgo";
|
import TimeAgo from "../dynamic/TimeAgo";
|
||||||
@ -19,7 +19,7 @@ import { cn } from "@/lib/utils";
|
|||||||
type SearchThumbnailProps = {
|
type SearchThumbnailProps = {
|
||||||
searchResult: SearchResult;
|
searchResult: SearchResult;
|
||||||
findSimilar: () => void;
|
findSimilar: () => void;
|
||||||
onClick: (searchResult: SearchResult, detail: boolean) => void;
|
onClick: (searchResult: SearchResult) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SearchThumbnail({
|
export default function SearchThumbnail({
|
||||||
@ -33,12 +33,9 @@ export default function SearchThumbnail({
|
|||||||
|
|
||||||
useContextMenu(imgRef, findSimilar);
|
useContextMenu(imgRef, findSimilar);
|
||||||
|
|
||||||
const handleOnClick = useCallback(
|
const handleOnClick = useCallback(() => {
|
||||||
(e: React.MouseEvent<HTMLDivElement>) => {
|
onClick(searchResult);
|
||||||
onClick(searchResult, e.metaKey);
|
}, [searchResult, onClick]);
|
||||||
},
|
|
||||||
[searchResult, onClick],
|
|
||||||
);
|
|
||||||
|
|
||||||
// date
|
// date
|
||||||
|
|
||||||
@ -85,7 +82,7 @@ export default function SearchThumbnail({
|
|||||||
<>
|
<>
|
||||||
<Chip
|
<Chip
|
||||||
className={`z-0 flex items-start justify-between space-x-1 bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500`}
|
className={`z-0 flex items-start justify-between space-x-1 bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500`}
|
||||||
onClick={() => onClick(searchResult, true)}
|
onClick={() => onClick(searchResult)}
|
||||||
>
|
>
|
||||||
{getIconForLabel(
|
{getIconForLabel(
|
||||||
searchResult.label,
|
searchResult.label,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user