commerce/components/cart/open-cart.tsx
Chloe 5c59c86d55
feat: implement profile popover
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
2024-04-16 14:56:05 +07:00

25 lines
579 B
TypeScript

import { ShoppingCartIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
export default function OpenCart({
className,
quantity
}: {
className?: string;
quantity?: number;
}) {
return (
<div className="relative">
<ShoppingCartIcon
className={clsx('h-5 transition-all ease-in-out hover:scale-110 ', className)}
/>
{quantity ? (
<div className="absolute right-0 top-0 -mr-2 -mt-2 h-4 w-4 rounded bg-blue-600 text-[11px] font-medium text-white">
{quantity}
</div>
) : null}
</div>
);
}