"use client"; import { NumberFormat } from "@/config/func"; import { Button } from "@/components/ui/button"; import Link from "next/link"; import { FC } from "react"; type CartSummaryProps = { itemsCount: number; itemsPrice: number; discount: number; shippingCost?: number; total: number; onConfirm?: () => void; confirmHref?: string; confirmLabel?: string; confirmDisabled?: boolean; onDownloadInvoice?: () => void; className?: string; isLoading?: boolean; }; const Row: FC<{ label: string; value: string | number; emphasize?: boolean }> = ( { label, value, emphasize } ) => { return (
{label}
{typeof value === "number" ? NumberFormat(value) : value}
); }; const CartSummary: FC = (props) => { const { itemsCount, itemsPrice, discount, shippingCost, total, onConfirm, onDownloadInvoice, className, confirmHref, confirmLabel, confirmDisabled, isLoading } = props; return (
تعداد کالاها
{NumberFormat(itemsCount)} محصول
{shippingCost !== undefined && shippingCost > 0 && ( )}
{onDownloadInvoice && ( )}
); }; export default CartSummary;