|
1
|
import { useTranslation } from "react-i18next" |
|
2
|
import { MoneyAmountCell } from "../../common/money-amount-cell" |
|
3
|
import { PlaceholderCell } from "../../common/placeholder-cell" |
|
4
|
|
|
5
|
type ShippingPriceCellProps = { |
|
6
|
isCalculated: boolean |
|
7
|
price?: number | null |
|
8
|
currencyCode: string |
|
9
|
} |
|
10
|
|
|
11
|
export const ShippingPriceCell = ({ |
|
12
|
price, |
|
13
|
currencyCode, |
|
14
|
isCalculated, |
|
15
|
}: ShippingPriceCellProps) => { |
|
16
|
if (isCalculated || !price) { |
|
17
|
return <PlaceholderCell /> |
|
18
|
} |
|
19
|
|
|
20
|
return <MoneyAmountCell currencyCode={currencyCode} amount={price} /> |
|
21
|
} |
|
22
|
|
|
23
|
export const ShippingPriceHeader = () => { |
|
24
|
const { t } = useTranslation() |
|
25
|
|
|
26
|
return ( |
|
27
|
<div className="flex items-center overflow-hidden"> |
|
28
|
<span className="truncate">{t("fields.price")}</span> |
|
29
|
</div> |
|
30
|
) |
|
31
|
} |