import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { CheckCircle, ArrowRight } from 'lucide-react' // 定义Feature类型 type Feature = { title: string description: string icon: 'CheckCircle' | 'ArrowRight' } // 定义组件props类型 type FeaturesProps = { items: Feature[] title: string } // 修改组件为接受props的形式 export default function Features({ items, title }: FeaturesProps) { // 创建图标映射 const iconMap = { CheckCircle: , ArrowRight: , } return ( {title} {items && items.map((feature, index) => ( {iconMap[feature.icon]} {feature.title} {feature.description} ))} ) }
{feature.description}