price-exceptions.tsx 865 B

123456789101112131415161718192021222324252627282930313233
  1. import { useTranslation } from 'react-i18next'
  2. import { PaidSubscription } from '../../../../../../types/subscription/dashboard/subscription'
  3. type PriceExceptionsProps = {
  4. subscription: PaidSubscription
  5. }
  6. export function PriceExceptions({ subscription }: PriceExceptionsProps) {
  7. const { t } = useTranslation()
  8. const { activeCoupons, taxRate } = subscription.payment
  9. return (
  10. <>
  11. {!(taxRate > 0) && (
  12. <p>
  13. <i>* {t('taxes_may_be_added')}</i>
  14. </p>
  15. )}
  16. {activeCoupons.length > 0 && (
  17. <>
  18. <i>* {t('coupons_not_included')}:</i>
  19. <ul data-testid="active-coupons">
  20. {activeCoupons.map(coupon => (
  21. <li key={coupon.code}>
  22. <i>{coupon.description || coupon.name}</i>
  23. </li>
  24. ))}
  25. </ul>
  26. </>
  27. )}
  28. </>
  29. )
  30. }