import { connection } from 'next/server';
import type { Product } from '#/types/product';
import { Ping } from '#/components/ping';
import { ProductEstimatedArrival } from '#/components/product-estimated-arrival';
import { ProductLowStockWarning } from '#/components/product-low-stock-warning';
import { ProductPrice } from '#/components/product-price';
import { ProductSplitPayments } from '#/components/product-split-payments';
import { ProductUsedPrice } from '#/components/product-used-price';
import { dinero, type DineroSnapshot } from 'dinero.js';
import { Suspense } from 'react';
import { AddToCart } from '#/components/add-to-cart';
import { delayShippingEstimate, withDelay } from '#/lib/delay';
import { cookies } from 'next/headers';
import { getProduct } from '#/lib/products';
async function AddToCartFromCookies() {
// Tell Next.js to render dynamically at runtime instead of build-time
await connection();
// Get the cart count from the users cookies and pass it to the client
// AddToCart component
const cartCount = Number(cookies().get('_cart_count')?.value || '0');
return