"use client";
import Link from "next/link";
import PersianNumber from "plugins/PersianNumber";
import React from "react";

const NavBarDownCart = ({ calculateTotalCost, event }) => {
  return (
    <div className="relative">
      <div className="fixed w-full bottom-[0] p-4 bg-body-100 border-t-[1px] border-gray-200 flex rtl">
        {/* <Link href={"/cart/checkout"} className="w-full"> */}
        <button
          className="btn btn-primary rounded-lg text-sm w-full"
          onClick={event}
        >
          ادامه فرایند خرید
        </button>
        {/* </Link> */}
        <div className="w-full mx-2">
          <p className="mb-0 text-sm  font-semibold text-primary-500 text-center">
            قابل پرداخت{" "}
          </p>
          <div className="flex justify-center">
            <p className="mb-0 ">
              <PersianNumber number={calculateTotalCost?.toLocaleString()} />
            </p>
            <small className="text-gray-500 text-[12px] mt-1 mx-1">
              {" "}
              تومان
            </small>
          </div>
        </div>
      </div>
    </div>
  );
};

export default NavBarDownCart;
