mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 23:25:25 +03:00
similarity search tweaks
This commit is contained in:
parent
6bc26cd59d
commit
615bedfa9c
@ -7,7 +7,7 @@ import React, {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { LuX, LuFilter } from "react-icons/lu";
|
import { LuX, LuFilter, LuImage } from "react-icons/lu";
|
||||||
import { SearchFilter, SearchSource } from "@/types/search";
|
import { SearchFilter, SearchSource } from "@/types/search";
|
||||||
|
|
||||||
type FilterType = keyof SearchFilter;
|
type FilterType = keyof SearchFilter;
|
||||||
@ -442,7 +442,7 @@ export default function InputWithTags({
|
|||||||
aria-expanded={showSuggestions}
|
aria-expanded={showSuggestions}
|
||||||
/>
|
/>
|
||||||
<div className="absolute right-2 top-1/2 -translate-y-1/2 transform space-x-1">
|
<div className="absolute right-2 top-1/2 -translate-y-1/2 transform space-x-1">
|
||||||
{Object.keys(filters).length > 0 && (
|
{(Object.keys(filters).length > 0 || isSimilaritySearch) && (
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
@ -454,7 +454,11 @@ export default function InputWithTags({
|
|||||||
: "text-secondary-foreground"
|
: "text-secondary-foreground"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<LuFilter className="h-4 w-4" />
|
{isSimilaritySearch ? (
|
||||||
|
<LuImage className="size-4" />
|
||||||
|
) : (
|
||||||
|
<LuFilter className="size-4" />
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{(inputValue || Object.keys(filters).length > 0) && (
|
{(inputValue || Object.keys(filters).length > 0) && (
|
||||||
@ -472,8 +476,9 @@ export default function InputWithTags({
|
|||||||
{((showFilters &&
|
{((showFilters &&
|
||||||
(Object.keys(filters).length > 0 || isSimilaritySearch)) ||
|
(Object.keys(filters).length > 0 || isSimilaritySearch)) ||
|
||||||
showSuggestions) && (
|
showSuggestions) && (
|
||||||
<div className="absolute left-0 top-12 z-[100] w-full rounded-md border border-t-0 border-secondary-foreground bg-background p-2 text-primary shadow-md">
|
<div className="absolute left-0 top-12 z-[100] w-full rounded-md border border-input bg-background p-2 text-primary shadow-md">
|
||||||
{showFilters && Object.keys(filters).length > 0 && (
|
{showFilters &&
|
||||||
|
(Object.keys(filters).length > 0 || isSimilaritySearch) && (
|
||||||
<div ref={filterRef} className="my-2 flex flex-wrap gap-2">
|
<div ref={filterRef} className="my-2 flex flex-wrap gap-2">
|
||||||
{isSimilaritySearch && (
|
{isSimilaritySearch && (
|
||||||
<span className="inline-flex items-center whitespace-nowrap rounded-full bg-blue-100 px-2 py-0.5 text-sm text-blue-800">
|
<span className="inline-flex items-center whitespace-nowrap rounded-full bg-blue-100 px-2 py-0.5 text-sm text-blue-800">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user