order page: integration
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
import { Card, Divider, Space } from "antd";
|
||||
import ArabicPrice from "components/ArabicPrice";
|
||||
import { selectCartTotal } from "features/order/orderSlice";
|
||||
import { Order } from "pages/checkout/hooks/types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
import ProText from "../ProText";
|
||||
import ProTitle from "../ProTitle";
|
||||
import styles from "./PaymentDetails.module.css";
|
||||
|
||||
export default function PaymentDetails() {
|
||||
export default function PaymentDetails({ order }: { order?: Order }) {
|
||||
const { t } = useTranslation();
|
||||
const total = useAppSelector(selectCartTotal);
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
|
||||
const subtotal = total;
|
||||
const tax = subtotal * 0.1; // 10% tax
|
||||
const finalTotal = subtotal + tax;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -26,7 +19,7 @@ export default function PaymentDetails() {
|
||||
<div className={`${styles.summaryRow} ${styles.totalRow}`}>
|
||||
<ProText strong>{t("cart.totalAmount")}</ProText>
|
||||
<ArabicPrice
|
||||
price={finalTotal}
|
||||
price={order?.total_price || 0}
|
||||
strong
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user