use restaurant currency

This commit is contained in:
2025-11-12 23:34:21 +03:00
parent df43d46ed2
commit 17b2f18957

View File

@@ -1,5 +1,4 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks";
import ProText from "../ProText";
@@ -20,8 +19,9 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
className,
hideCurrency = false,
}) => {
const { t } = useTranslation();
const { isRTL } = useAppSelector((state) => state.locale);
const {restaurant} = useAppSelector(state => state.order)
// Format the price to ensure it has 2 decimal places
const formattedPrice = typeof price === "number" ? price.toFixed(2) : price;
@@ -64,7 +64,7 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
...(decorationStyle ?? {}),
}}
>
{t("common.omanCurrency")}
{isRTL ? restaurant.local_currency : restaurant.global_currency}
</span>
</>
) : !hideCurrency ? (
@@ -88,8 +88,8 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
...(decorationStyle ?? {}),
}}
>
{t("common.omanCurrency")}
</span>
{isRTL ? restaurant.local_currency : restaurant.global_currency}
</span>
</>
) : (
<span style={decorationStyle}>{formattedPrice}</span>