import { useRef, useEffect, useState } from "react"; import { Loader2, Telescope } from "lucide-react"; interface ArtistScannerProps { value: string; onChange: (val: string) => void; disabled?: boolean; onExecute?: () => void; loading?: boolean; } export function ArtistScanner({ value, onChange, disabled, onExecute, loading }: ArtistScannerProps) { const textareaRef = useRef(null); const [isFocused, setIsFocused] = useState(false); useEffect(() => { const el = textareaRef.current; if (el) { el.style.height = "auto"; el.style.height = `${Math.max(el.scrollHeight, 56)}px`; } }, [value]); const canExecute = value.length > 3 && !disabled && !loading; const showCursor = !isFocused && !value; return (