diff --git a/packages/react/components/price/Price.tsx b/packages/react/components/price/Price.tsx index ea603d9c..45f96a68 100644 --- a/packages/react/components/price/Price.tsx +++ b/packages/react/components/price/Price.tsx @@ -3,10 +3,11 @@ import clsx from 'clsx' import { PriceProps } from './PriceProps' import { has, is } from '@/services/classify' import { Text, TextMarkup } from '../text' -import { Alignable, TypographyBold, TypographyColor } from '@/objects' +import { Alignable } from '@/objects' import { checkCents } from './PriceHelpers' import { hashClass } from '@/helpers' import { useTrilogyContext } from '@/context' +import { PriceLevel } from './PriceEnum' /** * Price Component @@ -18,7 +19,6 @@ import { useTrilogyContext } from '@/context' * @param inverted {boolean} Inverted Price Color * @param children {React.ReactNode} * @param align {Alignable} Price alignement - * @param inline {boolean} Inline display Price * @param accessibilityLabel {string} Accessibility label * @param overline {string} Price overline * @param oldAmount {boolean} old Amount Price @@ -33,7 +33,7 @@ const Price = ({ mention, period, hideCents = false, - level, + level = PriceLevel.ONE, inverted, align, accessibilityLabel, @@ -52,52 +52,42 @@ const Price = ({ let amountComponent = null let oldAmountComponent = null - const tagAmountComponent = null - if (oldAmount) { - const isNegativeStrike = oldAmount && oldAmount < 0 - const absoluteAmountStrike = oldAmount && Math.abs(oldAmount) - const absoluteWholeStrike = absoluteAmountStrike && Math.floor(absoluteAmountStrike) - const wholeStrike = isNegativeStrike && absoluteWholeStrike ? -absoluteWholeStrike : absoluteWholeStrike - - let cents = checkCents(absoluteAmountStrike.toString().split(/[.,]/)[1]?.substring(0, 2) || '') - cents = (cents && cents.length === 1 && `${cents}0`) || cents - const centsDisplayed = (!hideCents && `€${cents}`) || '€' - - oldAmountComponent = ( -