import React from 'react' import { View, Text } from '@tarojs/components' import { Gift, Voucher, Clock, Star } from '@nutui/icons-react-taro' export interface GiftCardStatsProps { /** 可用礼品卡数量 */ availableCount: number /** 已使用礼品卡数量 */ usedCount: number /** 已过期礼品卡数量 */ expiredCount: number /** 礼品卡总价值 */ totalValue?: number /** 点击统计项的回调 */ onStatsClick?: (type: 'available' | 'used' | 'expired' | 'total') => void } const GiftCardStats: React.FC = ({ availableCount, usedCount, expiredCount, totalValue, onStatsClick }) => { const handleStatsClick = (type: 'available' | 'used' | 'expired' | 'total') => { onStatsClick?.(type) } return ( {/* 紧凑的统计卡片 - 2x2 网格 */} {/* 可用礼品卡 */} handleStatsClick('available')} > 可用 {availableCount} {/* 已使用礼品卡 */} handleStatsClick('used')} > 已使用 {usedCount} {/* 已过期礼品卡 */} handleStatsClick('expired')} > 已过期 {expiredCount} {/* 总价值 */} {totalValue !== undefined && ( handleStatsClick('total')} > 总价值 ¥{totalValue} )} ) } export default GiftCardStats