31 lines
763 B
TypeScript
31 lines
763 B
TypeScript
'use client';
|
|
import { useState } from 'react';
|
|
import AddToCartButton from './AddToCartButton';
|
|
|
|
interface Props {
|
|
variantId: string;
|
|
productId: string;
|
|
productName: string;
|
|
priceCents: number;
|
|
imageUrl?: string;
|
|
available: boolean;
|
|
minPurchaseQty?: number;
|
|
}
|
|
|
|
export default function ProductAddToCart({ variantId, productId, productName, priceCents, imageUrl, available, minPurchaseQty }: Props) {
|
|
return (
|
|
<div className="mt-6">
|
|
<AddToCartButton
|
|
variantId={variantId}
|
|
productId={productId}
|
|
productName={productName}
|
|
priceCents={priceCents}
|
|
imageUrl={imageUrl}
|
|
available={available}
|
|
minPurchaseQty={minPurchaseQty}
|
|
className="w-full sm:w-auto"
|
|
/>
|
|
</div>
|
|
);
|
|
}
|