import { Image, Text, View } from '@tarojs/components';
import iconStoreBenefit from '../assets/icons/store-benefit-y.png';

type BenefitFigureSize = 'sm' | 'md' | 'lg' | 'xl';

type BenefitFigureProps = {
  value: string;
  size?: BenefitFigureSize;
  prefix?: string;
  className?: string;
};

/** 好客权益金额：门店核销图标 + 数字，替代人民币符号 */
export default function BenefitFigure({
  value,
  size = 'md',
  prefix = '',
  className = '',
}: BenefitFigureProps) {
  return (
    <View className={`benefit-figure benefit-figure--${size} ${className}`.trim()}>
      {prefix ? <Text className="benefit-figure-prefix">{prefix}</Text> : null}
      <Image className="benefit-figure-icon" src={iconStoreBenefit} mode="aspectFit" />
      <Text className="benefit-figure-value">{value}</Text>
    </View>
  );
}
