base logig pages cart shipping and payment

This commit is contained in:
hamid zarghami
2025-09-14 12:47:51 +03:30
parent 7b05f96576
commit 6d52d1e91a
13 changed files with 663 additions and 82 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ type CartSummaryProps = {
itemsCount: number;
itemsPrice: number;
discount: number;
shippingCost?: number;
total: number;
onConfirm?: () => void;
confirmHref?: string;
@@ -31,7 +32,7 @@ const Row: FC<{ label: string; value: string | number; emphasize?: boolean }> =
};
const CartSummary: FC<CartSummaryProps> = (props) => {
const { itemsCount, itemsPrice, discount, total, onConfirm, onDownloadInvoice, className, confirmHref, confirmLabel } = props;
const { itemsCount, itemsPrice, discount, shippingCost, total, onConfirm, onDownloadInvoice, className, confirmHref, confirmLabel } = props;
return (
<div className={"rounded-xl sm:rounded-2xl border border-border p-4 sm:p-6 h-fit bg-[#FAFAFA] " + (className ?? "")}>
@@ -43,6 +44,9 @@ const CartSummary: FC<CartSummaryProps> = (props) => {
<div className="mt-4 sm:mt-6 space-y-3 sm:space-y-5">
<Row label="قیمت کالاها" value={itemsPrice} />
<Row label="تخفیف" value={discount} />
{shippingCost !== undefined && shippingCost > 0 && (
<Row label="هزینه ارسال" value={shippingCost} />
)}
<Row label="جمع فاکتور" value={total} emphasize />
</div>