/** * Config Modal Component * Modal for configuring automation settings */ import React, { useState } from 'react'; import { AutomationConfig } from '../../services/automationService'; interface ConfigModalProps { config: AutomationConfig; onSave: (config: Partial) => void; onCancel: () => void; } const ConfigModal: React.FC = ({ config, onSave, onCancel }) => { const [formData, setFormData] = useState>({ is_enabled: config.is_enabled, frequency: config.frequency, scheduled_time: config.scheduled_time, stage_1_batch_size: config.stage_1_batch_size, stage_2_batch_size: config.stage_2_batch_size, stage_3_batch_size: config.stage_3_batch_size, stage_4_batch_size: config.stage_4_batch_size, stage_5_batch_size: config.stage_5_batch_size, stage_6_batch_size: config.stage_6_batch_size, within_stage_delay: config.within_stage_delay || 3, between_stage_delay: config.between_stage_delay || 5, }); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSave(formData); }; return (

Automation Configuration

{/* Enable/Disable */}

When enabled, automation will run on the configured schedule

{/* Frequency */}
{/* Scheduled Time */}
setFormData({ ...formData, scheduled_time: e.target.value }) } className="border rounded px-3 py-2 w-full" />

Time of day to run automation (24-hour format)

{/* Batch Sizes */}

Batch Sizes

Configure how many items to process in each stage

setFormData({ ...formData, stage_1_batch_size: parseInt(e.target.value), }) } min={1} max={100} className="border rounded px-3 py-2 w-full" />
setFormData({ ...formData, stage_2_batch_size: parseInt(e.target.value), }) } min={1} max={10} className="border rounded px-3 py-2 w-full" />
setFormData({ ...formData, stage_3_batch_size: parseInt(e.target.value), }) } min={1} max={100} className="border rounded px-3 py-2 w-full" />
setFormData({ ...formData, stage_4_batch_size: parseInt(e.target.value), }) } min={1} max={10} className="border rounded px-3 py-2 w-full" />
setFormData({ ...formData, stage_5_batch_size: parseInt(e.target.value), }) } min={1} max={10} className="border rounded px-3 py-2 w-full" />
setFormData({ ...formData, stage_6_batch_size: parseInt(e.target.value), }) } min={1} max={10} className="border rounded px-3 py-2 w-full" />
{/* AI Request Delays */}

AI Request Delays

Configure delays to prevent rate limiting and manage API load

setFormData({ ...formData, within_stage_delay: parseInt(e.target.value), }) } min={0} max={30} className="border rounded px-3 py-2 w-full" />

Delay between batches within a stage

setFormData({ ...formData, between_stage_delay: parseInt(e.target.value), }) } min={0} max={60} className="border rounded px-3 py-2 w-full" />

Delay between stage transitions

{/* Buttons */}
); }; export default ConfigModal;