import { PriceDisplay } from '@/components/ui/PriceDisplay'; import { Text } from '@/components/ui/Typography'; import { Flex } from '@/components/ui/layout'; import Badge from '@/components/ui/Badge'; import React from 'react'; interface ProductPricingProps { unitPrice: number | null; moq?: number | null; onRequestTKey: string; } interface ServicePricingProps { hourlyRate: number | null; serviceAreaKm?: number | null; onRequestTKey: string; } interface CommunityPricingProps { price: number | null; priceType?: string | null; freeTKey: string; } type MatchCardPricingProps = | ({ type: 'product' } & ProductPricingProps) | ({ type: 'service' } & ServicePricingProps) | ({ type: 'community' } & CommunityPricingProps); /** * Reusable pricing component for discovery match cards * Handles different pricing types (product, service, community) */ export const MatchCardPricing: React.FC = (props) => { if (props.type === 'product') { return ( {props.moq != null && props.moq > 0 && ( )} ); } if (props.type === 'service') { return ( {props.serviceAreaKm != null && ( )} ); } // Community pricing return ( {props.priceType && ( {props.priceType} )} ); }; export default React.memo(MatchCardPricing);