import React from 'react'; import { CalendarClock, Loader2, MessageSquareQuote, Play, Save, Sparkles, X } from 'lucide-react'; import { AccountDetail, AccountTaskSettings } from '../types'; import { useAccountAutomation } from '../app/features/accountAutomation/hooks'; interface Props { /** account 表示账号。 */ account: AccountDetail; /** onClose 表示关闭弹窗的回调。 */ onClose: () => void; /** onSaved 表示保存完成后的回调。 */ onSaved: (settings: AccountTaskSettings) => void; } // Toggle 渲染可复用的开关控件。 const Toggle: React.FC<{/** checked 表示开关当前是否选中。 */ checked: boolean; /** onChange 表示开关状态变化的回调。 */ onChange: () => void; /** label 表示控件的无障碍名称。 */ label: string}> = ({ checked, onChange, label }) => ( ); // AccountAutomationModal 渲染账号自动化设置弹窗。 const AccountAutomationModal: React.FC = ({ account, onClose, onSaved }) => { // automationState 是账号任务 feature Hook 提供的表单和动作状态。 const { form, loading, saving, running, error, summary, retryAvailable, setForm, save, run, retry } = useAccountAutomation({ account, onSaved }); return (

账号自动任务

{account.nickname || account.remark || account.id}

{loading &&
正在读取任务设置...
}

自动评价

持续扫描待评价订单,按订单执行;不是每日任务。

setForm(/* 当前回调处理用户交互或异步状态变化。 */ current => ({ ...current, auto_rate_enabled: !current.auto_rate_enabled }))} label="自动评价" />