OpenCart.tsx 735 B

1234567891011121314151617181920212223
  1. import { ShoppingCartIcon } from "@heroicons/react/24/outline";
  2. import clsx from "clsx";
  3. export default function OpenCart({
  4. className,
  5. quantity,
  6. }: {
  7. className?: string;
  8. quantity?: number | string;
  9. }) {
  10. return (
  11. <div className="relative flex items-center justify-center rounded-md w-6 h-6 border-0 lg:border border-solid border-neutral-200 dark:border-neutral-700 lg:h-11 lg:w-11">
  12. <ShoppingCartIcon className={clsx("h-5 w-5", className)} />
  13. {/* -mr-2 */}
  14. {quantity ? (
  15. <div className="absolute right-0 bottom-0 margin-t lg:-mt-2 w-3 h-3 rounded-full bg-[#FF4500FF] text-[11px] text-center leading-3 font-medium text-white">
  16. {quantity}
  17. </div>
  18. ) : null}
  19. </div>
  20. );
  21. }