import React from 'react';
import { formatPrice } from '../../utils/formatPrice';

interface PricesProps {
  price?: number;
  text?: string;
  className?: string;
}

export const Price = ({ text, price, className }: PricesProps) => {
  return (
    <p className={className}>
      {text}{' '}
      {price !== undefined && (
        <span className={price <= 0 ? 'badge' : undefined}>
          {formatPrice(price)}
        </span>
      )}
    </p>
  );
};
