storenest-commerce
Version:
Complete e-commerce SDK for Storenest platform with React components, multi-language support, secure checkout, and enterprise-grade security
28 lines (27 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckoutBox = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
// Simple loading component for SSR
const LoadingComponent = () => ((0, jsx_runtime_1.jsx)("div", { style: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
minHeight: '400px',
background: '#f8f9fa',
borderRadius: '8px'
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { textAlign: 'center' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: '24px', marginBottom: '16px' }, children: "\uD83D\uDD04" }), (0, jsx_runtime_1.jsx)("div", { children: "Loading checkout component..." })] }) }));
// Check if we're on the client side at module level
const isClient = typeof window !== 'undefined';
// SSR-Safe CheckoutBox Component
const CheckoutBox = (props) => {
// If we're on server side, return loading component immediately
if (!isClient) {
return (0, jsx_runtime_1.jsx)(LoadingComponent, {});
}
// For client side, we need to use a different approach
// Since we can't use hooks during SSR, we'll return loading and let the parent handle the dynamic import
return (0, jsx_runtime_1.jsx)(LoadingComponent, {});
};
exports.CheckoutBox = CheckoutBox;
exports.default = exports.CheckoutBox;