import React, { ComponentProps } from 'react'; import { Box } from '../Box'; import { Button } from '../Button'; import { ProgressBar } from '../ProgressBar'; import { Text } from '../Text'; type ProgressBarColor = ComponentProps['innerColor']; export interface IProductProgressBar extends ComponentProps { currentValue: number; totalValue: number; } export const ProductProgressBar = ({ currentValue, totalValue, ...buttonProps }: IProductProgressBar) => { const remainingItems = totalValue - currentValue; const progressColor: ProgressBarColor = currentValue < totalValue / 2 ? 'black' : remainingItems > 0 ? 'brightYellow' : 'green'; return ( {remainingItems ? `Te faltan ${remainingItems} productos` : 'Recepción completa'}