Spaces:
Sleeping
Sleeping
File size: 1,618 Bytes
5b7eaab | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 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;
|