From 0df3171b6478688f13b0a6a59a753e02910188d8 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 1 Jul 2025 20:14:42 +0800 Subject: [PATCH] chore: remove command --- .../ActionButton/AddMemoRelationPopover.tsx | 52 ++++---- web/src/components/ui/command.tsx | 111 ------------------ 2 files changed, 27 insertions(+), 136 deletions(-) delete mode 100644 web/src/components/ui/command.tsx diff --git a/web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx b/web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx index d1a210b43..43c0e6205 100644 --- a/web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx +++ b/web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx @@ -6,7 +6,7 @@ import useDebounce from "react-use/lib/useDebounce"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; -import { Command, CommandInput, CommandItem, CommandList, CommandEmpty } from "@/components/ui/command"; +import { Input } from "@/components/ui/input"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { memoServiceClient } from "@/grpcweb"; import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts"; @@ -157,34 +157,36 @@ const AddMemoRelationPopover = (props: Props) => { )} {/* Search and selection interface */} - - + setSearchText(e.target.value)} + className="h-9 mb-2" /> - - {isFetching ? "Loading..." : t("reference.no-memos-found")} - {filteredMemos.map((memo) => ( - { - setSelectedMemos((prev) => [...prev, memo]); - }} - className="cursor-pointer" - > -
-

{memo.displayTime?.toLocaleString()}

-

- {searchText ? getHighlightedContent(memo.content) : memo.snippet} -

+
+ {filteredMemos.length === 0 ? ( +
{isFetching ? "Loading..." : t("reference.no-memos-found")}
+ ) : ( + filteredMemos.map((memo) => ( +
{ + setSelectedMemos((prev) => [...prev, memo]); + }} + > +
+

{memo.displayTime?.toLocaleString()}

+

+ {searchText ? getHighlightedContent(memo.content) : memo.snippet} +

+
- - ))} - - + )) + )} +
+
diff --git a/web/src/components/ui/command.tsx b/web/src/components/ui/command.tsx deleted file mode 100644 index fa516f9b8..000000000 --- a/web/src/components/ui/command.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { Command as CommandPrimitive } from "cmdk"; -import { SearchIcon } from "lucide-react"; -import * as React from "react"; -import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog"; -import { cn } from "@/lib/utils"; - -function Command({ className, ...props }: React.ComponentProps) { - return ( - - ); -} - -function CommandDialog({ - title = "Command Palette", - description = "Search for a command to run...", - children, - className, - showCloseButton = true, - ...props -}: React.ComponentProps & { - title?: string; - description?: string; - className?: string; - showCloseButton?: boolean; -}) { - return ( - - - {title} - {description} - - - - {children} - - - - ); -} - -function CommandInput({ className, ...props }: React.ComponentProps) { - return ( -
- - -
- ); -} - -function CommandList({ className, ...props }: React.ComponentProps) { - return ( - - ); -} - -function CommandEmpty({ ...props }: React.ComponentProps) { - return ; -} - -function CommandGroup({ className, ...props }: React.ComponentProps) { - return ( - - ); -} - -function CommandSeparator({ className, ...props }: React.ComponentProps) { - return ; -} - -function CommandItem({ className, ...props }: React.ComponentProps) { - return ( - - ); -} - -function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) { - return ( - - ); -} - -export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };