import { useTranslation } from 'react-i18next' import Price, { Currency, Locale } from './Price' import './styles.css' type PaymentItem = { title: string price: number description: string } type PaymentProps = { currency: Currency locale: Locale items: PaymentItem[] } function Payment({ currency, locale, items }: PaymentProps): JSX.Element { const { t } = useTranslation() const total = items.reduce((acc, item) => acc + item.price, 0) const totalPrice = new Price(total, currency, locale) const toItem = (item: typeof items[0], idx: number) => { const price = new Price(item.price, currency, locale) return (
{item.description}
One dollar thirty six cents per day