import type { ComponentType } from 'react'; import React from 'react'; import type { LucideProps } from 'lucide-react'; import { ChevronRight } from 'lucide-react'; import type { PaletteColorKey } from '@/config/features'; import { cn } from '@/lib/utils'; const PALETTE_COLORS: Record = { primary: '13, 148, 136', // teal success: '22, 163, 74', // green warning: '217, 119, 6', // amber (存储清理的橙色轴) error: '220, 38, 38', // red secondary: '147, 51, 232', info: '37, 99, 235', // blue }; export interface ToolCardProps extends React.HTMLAttributes { title: string; description?: string; snapshot?: React.ReactNode; colorKey: PaletteColorKey; icon: ComponentType; onNavigate: () => void; } export default function ToolCard({ title, description, snapshot, colorKey, icon: IconComponent, onNavigate, className, ...props }: ToolCardProps) { const rgbValues = PALETTE_COLORS[colorKey]; return (
{/* 上半部分:核心信息交互排版轴 */}
{/* 左侧圆形图标容器 */}
{/* 中间文字描述区:利用 flex-1 min-w-0 防御文本过长发生恶性撑开 */}

{title}

{description && (

{description}

)}
{/* 右侧指示小箭头 */}
{/* 覆盖整个上半部分的绝对定位隐形跳转层(A11y 无障碍标准合规) */}
{/* 下半部分:未来的动态预览沙箱独立承载区 */} {snapshot != null && (
{snapshot}
)}
); } ToolCard.displayName = 'ToolCard';