()
| 4 | import { usePipelineStore } from '../../store/pipelineStore'; |
| 5 | |
| 6 | const QuickActions: React.FC = () => { |
| 7 | const { sendMessage } = useChatStore(); |
| 8 | const { currentPipeline } = usePipelineStore(); |
| 9 | |
| 10 | const quickActions = [ |
| 11 | { |
| 12 | label: 'Add URL', |
| 13 | prompt: 'I want to add a new URL to scrape', |
| 14 | icon: '🔗' |
| 15 | }, |
| 16 | { |
| 17 | label: 'Define Schema', |
| 18 | prompt: 'Help me define the data schema for extraction', |
| 19 | icon: '📋' |
| 20 | }, |
| 21 | { |
| 22 | label: 'Generate Code', |
| 23 | prompt: 'Generate the Python code for my scraping pipeline', |
| 24 | icon: '💻' |
| 25 | }, |
| 26 | { |
| 27 | label: 'Run Pipeline', |
| 28 | prompt: 'Execute the scraping pipeline', |
| 29 | icon: '▶️' |
| 30 | } |
| 31 | ]; |
| 32 | |
| 33 | const handleAction = (prompt: string) => { |
| 34 | if (currentPipeline) { |
| 35 | sendMessage(prompt, currentPipeline.id); |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | return ( |
| 40 | <div className="flex flex-wrap gap-2"> |
| 41 | {quickActions.map((action) => ( |
| 42 | <Button |
| 43 | key={action.label} |
| 44 | variant="secondary" |
| 45 | size="sm" |
| 46 | onClick={() => handleAction(action.prompt)} |
| 47 | disabled={!currentPipeline} |
| 48 | > |
| 49 | <span className="mr-1">{action.icon}</span> |
| 50 | {action.label} |
| 51 | </Button> |
| 52 | ))} |
| 53 | </div> |
| 54 | ); |
| 55 | }; |
| 56 | |
| 57 | export default QuickActions; |
nothing calls this directly
no test coverage detected