import React from 'react'; export interface ICostFactorProps { min: number; max?: number; } export const CostFactor = ({ min, max }: ICostFactorProps) => { const MAX_DOLLARS = 4; const minDollars = ( <> {'$'.repeat(min)} {'$'.repeat(MAX_DOLLARS - min)} ); const maxDollars = ( <> {'$'.repeat(Math.min(MAX_DOLLARS, max))} {'$'.repeat(MAX_DOLLARS - Math.min(MAX_DOLLARS, max))} ); return ( {minDollars} {max ? ` - ${maxDollars}` : ''} ); };