|
1 | 1 | import React, { useState, useEffect } from 'react'; |
2 | | -import { Button, Input, Modal, List, Space, Card } from 'antd'; |
| 2 | +import { Input, Modal, List, Card } from 'antd'; |
3 | 3 | import { DeleteOutlined, HolderOutlined, PlusOutlined } from '@ant-design/icons'; |
4 | 4 | import { TaskStep, TaskTemplate } from '@/models'; |
5 | 5 | import { useScheduledTaskStore } from '@/stores/scheduled-task-store'; |
6 | 6 | import { useTranslation } from 'react-i18next'; |
| 7 | +import { ActionButton } from '@/components/ui'; |
7 | 8 |
|
8 | 9 | interface TaskStepEditorProps { |
9 | 10 | value?: TaskStep[]; |
@@ -105,20 +106,19 @@ export const TaskStepEditor: React.FC<TaskStepEditorProps> = ({ value = [], onCh |
105 | 106 | <div className="task-step-editor"> |
106 | 107 | {/* Action buttons */} |
107 | 108 | <div className="mb-4 flex gap-2"> |
108 | | - <Button |
109 | | - type="primary" |
| 109 | + <ActionButton |
| 110 | + variant="primary" |
110 | 111 | icon={<PlusOutlined />} |
111 | 112 | onClick={handleAddStep} |
112 | | - className="!bg-primary hover:!bg-primary-hover !border-none cursor-pointer transition-all duration-200" |
113 | 113 | > |
114 | 114 | {t('manual_add_step')} |
115 | | - </Button> |
116 | | - <Button |
| 115 | + </ActionButton> |
| 116 | + <ActionButton |
| 117 | + variant="secondary" |
117 | 118 | onClick={() => setShowTemplateModal(true)} |
118 | | - className="!bg-white dark:!bg-white/10 !border-gray-200 dark:!border-white/10 !text-gray-700 dark:!text-gray-300 hover:!bg-gray-100 dark:hover:!bg-white/20 hover:!border-primary/30 cursor-pointer transition-all duration-200" |
119 | 119 | > |
120 | 120 | {t('import_from_template')} |
121 | | - </Button> |
| 121 | + </ActionButton> |
122 | 122 | </div> |
123 | 123 |
|
124 | 124 | {/* Step list */} |
@@ -166,28 +166,27 @@ export const TaskStepEditor: React.FC<TaskStepEditorProps> = ({ value = [], onCh |
166 | 166 |
|
167 | 167 | {/* Action buttons */} |
168 | 168 | <div className="flex flex-col gap-1"> |
169 | | - <Button |
| 169 | + <ActionButton |
| 170 | + variant="secondary" |
170 | 171 | size="small" |
171 | 172 | onClick={() => handleMoveUp(index)} |
172 | 173 | disabled={index === 0} |
173 | | - className="!bg-white dark:!bg-white/10 !border-gray-200 dark:!border-white/10 !text-gray-700 dark:!text-gray-300 hover:!bg-gray-100 dark:hover:!bg-white/20 disabled:opacity-50 cursor-pointer transition-all duration-200" |
174 | 174 | > |
175 | 175 | ↑ |
176 | | - </Button> |
177 | | - <Button |
| 176 | + </ActionButton> |
| 177 | + <ActionButton |
| 178 | + variant="secondary" |
178 | 179 | size="small" |
179 | 180 | onClick={() => handleMoveDown(index)} |
180 | 181 | disabled={index === steps.length - 1} |
181 | | - className="!bg-white dark:!bg-white/10 !border-gray-200 dark:!border-white/10 !text-gray-700 dark:!text-gray-300 hover:!bg-gray-100 dark:hover:!bg-white/20 disabled:opacity-50 cursor-pointer transition-all duration-200" |
182 | 182 | > |
183 | 183 | ↓ |
184 | | - </Button> |
185 | | - <Button |
| 184 | + </ActionButton> |
| 185 | + <ActionButton |
| 186 | + variant="danger" |
186 | 187 | size="small" |
187 | | - danger |
188 | 188 | icon={<DeleteOutlined />} |
189 | 189 | onClick={() => handleRemoveStep(step.id)} |
190 | | - className="!bg-red-500/10 !border-red-500/30 hover:!bg-red-500/20 hover:!border-red-500/50 cursor-pointer transition-all duration-200" |
191 | 190 | /> |
192 | 191 | </div> |
193 | 192 | </div> |
@@ -223,13 +222,12 @@ export const TaskStepEditor: React.FC<TaskStepEditorProps> = ({ value = [], onCh |
223 | 222 | </div> |
224 | 223 | } |
225 | 224 | /> |
226 | | - <Button |
227 | | - type="primary" |
| 225 | + <ActionButton |
| 226 | + variant="primary" |
228 | 227 | size="small" |
229 | | - className="!bg-primary hover:!bg-primary-hover !border-none cursor-pointer transition-all duration-200" |
230 | 228 | > |
231 | 229 | {t('select')} |
232 | | - </Button> |
| 230 | + </ActionButton> |
233 | 231 | </List.Item> |
234 | 232 | )} |
235 | 233 | /> |
|
0 commit comments