import React from 'react';

const Controls = ({ onSeedDemo, onClearDemo, onEvictStale, loading, onShowHelp }) => {
  return (
    <div className="controls">
      <button 
        className="btn btn-success" 
        onClick={onSeedDemo}
        disabled={loading}
        style={{ 
          opacity: loading ? 0.6 : 1,
          cursor: loading ? 'not-allowed' : 'pointer'
        }}
      >
        {loading ? (
          <>
            <span className="spinner" />
            Seeding...
          </>
        ) : (
          'Seed Demo'
        )}
      </button>
      
      <button 
        className="btn btn-danger" 
        onClick={onClearDemo}
        disabled={loading}
        style={{ 
          opacity: loading ? 0.6 : 1,
          cursor: loading ? 'not-allowed' : 'pointer'
        }}
      >
        {loading ? (
          <>
            <span className="spinner" />
            Clearing...
          </>
        ) : (
          'Clear'
        )}
      </button>
      
      <button 
        className="btn btn-secondary" 
        onClick={onEvictStale}
        disabled={loading}
        style={{ 
          opacity: loading ? 0.6 : 1,
          cursor: loading ? 'not-allowed' : 'pointer'
        }}
      >
        {loading ? (
          <>
            <span className="spinner" />
            Evicting...
          </>
        ) : (
          'Evict Stale (120m)'
        )}
      </button>
      
      <button 
        className="btn" 
        onClick={onShowHelp}
        style={{ background: '#8b5cf6' }}
      >
        Help
      </button>
    </div>
  );
};

export default Controls;
