| 20 | |
| 21 | // Auto-create a pipeline on first load |
| 22 | const initializePipeline = async () => { |
| 23 | await fetchPipelines(); |
| 24 | |
| 25 | // If no current pipeline, create one automatically |
| 26 | if (!currentPipeline) { |
| 27 | await createPipeline({ |
| 28 | name: 'My Scraping Pipeline', |
| 29 | description: 'Ready to scrape the web!' |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | // Small delay to ensure smooth loading experience |
| 34 | setTimeout(() => { |
| 35 | setIsInitializing(false); |
| 36 | }, 500); |
| 37 | }; |
| 38 | |
| 39 | initializePipeline(); |
| 40 | }, []); // eslint-disable-line react-hooks/exhaustive-deps |