Songwat Road Terminal
{item.name}
Block Allocation Authorized
Terminal transactions are final. Billing entity: The Little Soi Co Ltd.
Current Payload
{totals.gross.toLocaleString()} ฿
import React, { useState, useEffect, useMemo } from 'react';
import {
Plane,
ShoppingCart,
ChevronLeft,
ShieldCheck,
Terminal,
ChevronRight,
Zap,
Info,
Clock,
ArrowUpRight
} from 'lucide-react';
// --- CONFIGURATION ---
const NODE_ID = "903-BKK";
const BLOCK_PRICE = 903;
const VAT_RATE = 0.07;
// REPLACE THIS LINK WITH YOUR ACTUAL STRIPE PAYMENT LINK
const STRIPE_BASE_URL = "https://buy.stripe.com/your_link_here";
const PRODUCTS = [
{ id: 'tote-0', name: 'ZERO TOTE', category: 'HARDWARE', blocks: 4, desc: 'Aero-grade rivets, raw hide' },
{ id: 'msg-0', name: 'MESSENGER', category: 'HARDWARE', blocks: 5, desc: 'Technical carry system' },
{ id: 'blk-0', name: 'BRICK 903', category: 'HARDWARE', blocks: 1, desc: 'Modular storage unit' },
{ id: 'fuel-hot', name: 'FUEL: HOT', category: 'REFUEL', price: 60, desc: 'Black Gasoline - Single Lead' },
{ id: 'fuel-cold', name: 'FUEL: COLD', category: 'REFUEL', price: 60, desc: 'Black Gasoline - High Octane' },
];
// --- MAIN APPLICATION ---
const App = () => {
const [cart, setCart] = useState([]);
const [view, setView] = useState('MANIFEST'); // MANIFEST, CHECKOUT
const [currentTime, setCurrentTime] = useState('');
// Clock Update & Global Styles
useEffect(() => {
const timer = setInterval(() => {
setCurrentTime(new Date().toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' }));
}, 1000);
const link = document.createElement('link');
link.href = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&family=Inter:wght@400;700;900&display=swap";
link.rel = "stylesheet";
document.head.appendChild(link);
return () => clearInterval(timer);
}, []);
const addToCart = (product) => {
setCart(prev => [...prev, { ...product, instanceId: Math.random() }]);
};
const removeFromCart = (instanceId) => {
setCart(prev => prev.filter(item => item.instanceId !== instanceId));
};
const totals = useMemo(() => {
const totalBlocks = cart.reduce((acc, item) => acc + (item.blocks || 0), 0);
const gross = cart.reduce((acc, item) => {
const price = item.blocks ? item.blocks * BLOCK_PRICE : item.price;
return acc + price;
}, 0);
const net = gross / (1 + VAT_RATE);
const vat = gross - net;
return { gross, net, vat, totalBlocks };
}, [cart]);
const handleStripeCheckout = () => {
if (cart.length === 0) return;
// Logic: If using Stripe Payment Links with quantities enabled,
// we can pass the total blocks or total units as a quantity parameter.
// Note: This requires the Stripe Link to have "Adjustable Quantity" enabled.
const checkoutUrl = new URL(STRIPE_BASE_URL);
// We redirect to the Stripe checkout page
// For specific block-based logic, users can also use Stripe Price IDs
window.location.href = checkoutUrl.toString();
};
// --- SUB-COMPONENTS ---
const Header = () => (
{currentTime} BKKDWNTWN
{product.desc}
Songwat Road Terminal
{item.name}
Block Allocation Authorized
Terminal transactions are final. Billing entity: The Little Soi Co Ltd.
Current Payload
{totals.gross.toLocaleString()} ฿