"use client"; import { useRouter } from "next/navigation"; import type { ReactNode } from "react"; import { useState } from "react"; type Props = { productId: string; variantId?: string | null; quantity?: number; configuration?: Record; className?: string; children?: ReactNode; redirectToCart?: boolean; }; export function AddToCartButton({ productId, variantId, quantity = 1, configuration = {}, className, children = "Add to cart", redirectToCart = false, }: Props) { const router = useRouter(); const [loading, setLoading] = useState(false); async function ensureSession() { await fetch("/api/auth/demo", { cache: "no-store" }); } return ( ); }