import React, { FC } from 'react';

import css from './index.module.css';

export interface PriceProps {
  amount: string;
  original?: string;
}

const Price: FC<PriceProps> = ({ amount, original }) => {
  return original ? (
    <span className={css.price} data-testid="Price">
      <span className={css.original__price__amount}>{original}</span>
      <span className={css.price__amount__discounted}>{amount}</span>
    </span>
  ) : (
    <span className={css.price} data-testid="Price">
      {amount}
    </span>
  );
};

export default Price;
