grand commit

This commit is contained in:
2025-02-07 08:34:42 +02:00
parent f594f001f6
commit c6c34f0453
53 changed files with 1283 additions and 625 deletions

View File

@@ -0,0 +1,31 @@
'use client'
import {ShoppingCartIcon} from 'lucide-react'
import {useTranslations} from 'next-intl'
import useCartStore, {CartItem} from '@/store/cart-store'
import {Button} from '@/ui/button'
export default function CardBuyButton({
item,
isIcon
}: {
item: CartItem
isIcon?: boolean
}) {
const t = useTranslations('cart')
const addItemToCart = useCartStore(state => state.addItemToCart)
return (
<Button
className={`mr-2 ${isIcon ? '' : 'w-[80px]'} grow-0 shadow-white hover:shadow-md hover:shadow-brand-violet/50`}
onClick={() => addItemToCart(item)}
>
{isIcon ? (
<ShoppingCartIcon role='button' className='bw-cart-btn p-1' />
) : (
t('buy')
)}
</Button>
)
}