import React from 'react';

const UrlInput = ({ url, setUrl, onAnalyze, isLoading }) => {
  return (
    <div className="card">
      <div className="input-group">
        <input
          type="text"
          placeholder="Paste image URL here..."
          value={url}
          onChange={(e) => setUrl(e.target.value)}
          disabled={isLoading}
        />
        <button onClick={onAnalyze} disabled={isLoading || !url.trim()}>
          {isLoading ? <div className="loading-spinner" /> : 'Analyze Shelf'}
        </button>
      </div>
    </div>
  );
};

export default UrlInput;
