/** * Action Card - Deep Link 动作卡片 * * 100%还原原型图Action Card设计 */ import React from 'react'; import { Calculator, ExternalLink, Rocket } from 'lucide-react'; import type { ActionCard } from '../types'; interface ActionCardProps { card: ActionCard; } const CARD_ICONS: Record> = { sample_size_calculator: Calculator, generate_protocol: Rocket, }; export const ActionCardComponent: React.FC = ({ card }) => { const Icon = CARD_ICONS[card.id] || Calculator; const handleClick = () => { if (card.type === 'tool') { // 打开工具页面(新标签页或模态框) window.open(card.actionUrl, '_blank'); } else if (card.type === 'action') { // 触发动作(如一键生成) // 这里会被父组件处理 console.log('Action triggered:', card.id); } }; return (

{card.title}

{card.description}

{card.type === 'tool' && (

点击将打开工具面板,参数已自动预填

)} {card.type === 'action' && ( )}
); };