refactor(copy-rule): extract context and improve batch clone modal

- Extract MultiCopyPopupContext to standalone context.ts file
- Add Task type and improve type safety in BatchCloneModal
- Use useRef/useCallback to stabilize batch clone handlers
- Add cleanup effect for selectRules in RuleCheckCard on unmount

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 23:05:56 +08:00
parent 16999ca583
commit 3c636bcaa2
6 changed files with 61 additions and 48 deletions

View File

@@ -3,7 +3,7 @@ import { ProFormDependency, ProFormSelect } from '@ant-design/pro-components';
import { Divider, Flex, Tag, Typography } from 'antd';
import { useContext, useEffect, useMemo } from 'react';
import { $t } from '@/utils/i18n';
import { MultiCopyPopupContext } from '../MultiCopyPopup';
import { MultiCopyPopupContext } from '../context';
import RuleCheckCard from './RuleCheckCard';
type Step1Props = {