diff --git a/frontend/src/components/ui/dropdown-selector.tsx b/frontend/src/components/ui/dropdown-selector.tsx deleted file mode 100644 index 7d435d7c..00000000 --- a/frontend/src/components/ui/dropdown-selector.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import { useState } from "react"; - -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { cn, truncateMiddle } from "@/lib/utils"; - -export interface DropdownSelectorOption { - value: T; - label: string; -} - -interface DropdownSelectorProps { - value: T; - options: DropdownSelectorOption[]; - onChange: (value: T) => void; - triggerClassName?: string; - contentClassName?: string; -} - -function ChevronDownIcon() { - return ( - - - - ); -} - -function ChevronUpIcon() { - return ( - - - - ); -} - -export function DropdownSelector({ - value, - options, - onChange, - triggerClassName, - contentClassName, -}: DropdownSelectorProps) { - const selectedOption = options.find((opt) => opt.value === value); - const [isOpen, setIsOpen] = useState(false); - - return ( - - - - {truncateMiddle(selectedOption?.label ?? value, 50)} - {isOpen ? : } - - - - onChange(v as T)} - > - {options.map((option) => ( - - {truncateMiddle(option.label)} - - ))} - - - - ); -} \ No newline at end of file diff --git a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx index 8423617a..7a34667c 100644 --- a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx +++ b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx @@ -23,7 +23,14 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -import { DropdownSelector } from "@/components/ui/dropdown-selector"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import { CodeEditor } from "@/components/workspace/code-editor"; import { useArtifactContent } from "@/core/artifacts/hooks"; @@ -247,11 +254,20 @@ export function ArtifactFileDetail({ {isWriteFile ? (
{truncateMiddle(getFileName(filepath), 50)}
) : ( - + )}