'use client'; import { motion } from 'framer-motion'; import { CloseIcon } from './Icons'; export default function ScanImportConfirmModal({ scannedFunds, selectedScannedCodes, onClose, onToggle, onConfirm, refreshing }) { return ( e.stopPropagation()} style={{ width: 460, maxWidth: '90vw' }} >
确认导入基金
{scannedFunds.length === 0 ? (
未识别到有效的基金代码,请尝试更清晰的截图或手动搜索。
) : (
{scannedFunds.map((item) => { const isSelected = selectedScannedCodes.has(item.code); const isAlreadyAdded = item.status === 'added'; const isInvalid = item.status === 'invalid'; const isDisabled = isAlreadyAdded || isInvalid; const displayName = item.name || (isInvalid ? '未找到基金' : '未知基金'); return (
e.preventDefault()} onClick={() => { if (isDisabled) return; onToggle(item.code); }} style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }} >
{displayName} #{item.code}
{isAlreadyAdded ? ( 已添加 ) : isInvalid ? ( 未找到 ) : (
{isSelected &&
}
)}
); })}
)}
); }