import { Button } from "@/components/ui/button"; import { InputWithContext } from "@/components/ui/input-with-context"; import { Label } from "@/components/ui/label"; import { Search, Info, XCircle } from "lucide-react"; import { Spinner } from "@/components/ui/spinner"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { FetchHistory } from "@/components/FetchHistory"; import type { HistoryItem } from "@/components/FetchHistory"; interface SearchBarProps { url: string; loading: boolean; onUrlChange: (url: string) => void; onFetch: () => void; history: HistoryItem[]; onHistorySelect: (item: HistoryItem) => void; onHistoryRemove: (id: string) => void; hasResult: boolean; } export function SearchBar({ url, loading, onUrlChange, onFetch, history, onHistorySelect, onHistoryRemove, hasResult, }: SearchBarProps) { return (

Supports track, album, playlist, and artist URLs

onUrlChange(e.target.value)} onKeyDown={(e) => e.key === "Enter" && onFetch()} className="pr-8" /> {url && ( )}
{!hasResult && ( )}
); }