import React from 'react' import { View, Text } from '@tarojs/components' import { Gift, Voucher, Clock } from '@nutui/icons-react-taro' export interface CouponStatsProps { /** 可用优惠券数量 */ availableCount: number /** 已使用优惠券数量 */ usedCount: number /** 已过期优惠券数量 */ expiredCount: number /** 点击统计项的回调 */ onStatsClick?: (type: 'available' | 'used' | 'expired') => void } const CouponStats: React.FC = ({ availableCount, usedCount, expiredCount, onStatsClick }) => { const handleStatsClick = (type: 'available' | 'used' | 'expired') => { onStatsClick?.(type) } return ( 优惠券统计 {/* 可用优惠券 */} handleStatsClick('available')} > {availableCount} 可用 {/* 已使用优惠券 */} handleStatsClick('used')} > {usedCount} 已使用 {/* 已过期优惠券 */} handleStatsClick('expired')} > {expiredCount} 已过期 ) } export default CouponStats