()
| 3 | import { useWebSocketStore } from '../../store/websocketStore'; |
| 4 | |
| 5 | const StatusBar: React.FC = () => { |
| 6 | const { currentPipeline } = usePipelineStore(); |
| 7 | const { connectionStatus } = useWebSocketStore(); |
| 8 | |
| 9 | const getStatusColor = (status: string) => { |
| 10 | switch (status) { |
| 11 | case 'connected': |
| 12 | return 'text-success'; |
| 13 | case 'connecting': |
| 14 | return 'text-warning'; |
| 15 | case 'disconnected': |
| 16 | return 'text-error'; |
| 17 | default: |
| 18 | return 'text-muted'; |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | return ( |
| 23 | <div className="bg-secondary border-t border-border px-6 py-2 flex items-center justify-between text-sm"> |
| 24 | <div className="flex items-center space-x-6"> |
| 25 | <div className="flex items-center space-x-2"> |
| 26 | <span className="text-muted">Status:</span> |
| 27 | <span className={getStatusColor(currentPipeline?.status || 'idle')}> |
| 28 | {currentPipeline?.status || 'Idle'} |
| 29 | </span> |
| 30 | </div> |
| 31 | |
| 32 | <div className="flex items-center space-x-2"> |
| 33 | <span className="text-muted">URLs:</span> |
| 34 | <span>{currentPipeline?.urls.length || 0}</span> |
| 35 | </div> |
| 36 | |
| 37 | <div className="flex items-center space-x-2"> |
| 38 | <span className="text-muted">Schema Fields:</span> |
| 39 | <span>{Object.keys(currentPipeline?.schema || {}).length}</span> |
| 40 | </div> |
| 41 | </div> |
| 42 | |
| 43 | <div className="flex items-center space-x-4 text-xs text-muted"> |
| 44 | <span>ScrapeCraft made by ScrapeGraphAI</span> |
| 45 | <div className="flex items-center space-x-2"> |
| 46 | <div className={`w-2 h-2 rounded-full ${connectionStatus === 'connected' ? 'bg-success' : 'bg-error'}`} /> |
| 47 | <span className={getStatusColor(connectionStatus)}> |
| 48 | {connectionStatus} |
| 49 | </span> |
| 50 | </div> |
| 51 | </div> |
| 52 | </div> |
| 53 | ); |
| 54 | }; |
| 55 | |
| 56 | export default StatusBar; |
nothing calls this directly
no test coverage detected