"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";
import { FaArrowLeft } from "react-icons/fa";

export default function NavbarCheckoutBack() {
  const pathname = usePathname();

  if (pathname !== "/checkout") {
    return null;
  }

  return (
    <Link
      href="/cart"
      className="inline-flex items-center gap-2 px-4 py-2 bg-slate-900 hover:bg-slate-800 text-white font-extrabold text-[11px] tracking-wider uppercase rounded-xl transition-all shadow-sm select-none"
    >
      <FaArrowLeft className="text-[9px]" /> Back to Cart
    </Link>
  );
}
