import { useState } from "react"; import { FaSmile, FaLaugh, FaStar, FaCog } from "react-icons/fa"; export default function StickerStore() { const [cart, setCart] = useState([]); const [email, setEmail] = useState(""); const [user, setUser] = useState(null); const products = [ { id: 1, name: "Sticker 1", price: 3.99, colorClass: "bg-orange-200" }, { id: 2, name: "Sticker 2", price: 4.99, colorClass: "bg-blue-200" }, { id: 3, name: "Sticker 3", price: 2.99, colorClass: "bg-green-200" }, { id: 4, name: "Sticker 4", price: 5.49, colorClass: "bg-purple-200" } ]; const categories = [ { name: "Cute", icon: }, { name: "Funny", icon: }, { name: "Holographic", icon: }, { name: "Custom", icon: } ]; function addToCart(product) { setCart((prev) => { const idx = prev.findIndex((p) => p.id === product.id); if (idx === -1) return [...prev, { ...product, qty: 1 }]; const copy = [...prev]; copy[idx] = { ...copy[idx], qty: copy[idx].qty + 1 }; return copy; }); } function removeFromCart(index) { setCart((prev) => prev.filter((_, i) => i !== index)); } function updateQty(index, qty) { setCart((prev) => { const copy = [...prev]; if (qty <= 0) { copy.splice(index, 1); } else { copy[index] = { ...copy[index], qty }; } return copy; }); } function cartItemCount() { return cart.reduce((s, p) => s + (p.qty || 0), 0); } function cartTotal() { return cart.reduce((s, p) => s + (p.qty || 0) * p.price, 0).toFixed(2); } function handleSubscribe() { if (!email) return; alert(`Subscribed with ${email}`); setEmail(""); } function handleLogin() { setUser({ name: "Guest User" }); } function handleLogout() { setUser(null); } function handleCheckout() { if (cart.length === 0) return alert("Your cart is empty"); alert(`Checking out ${cartItemCount()} item(s). Total: $${cartTotal()}`); setCart([]); } return (
StickerCo
{user ? ( ) : ( )}

New Season, Fresh Stickers ✨

Discover our latest collection of fun and creative designs.

Shop by Category

{categories.map((cat) => ( ))}

Best Sellers

{products.map((product, idx) => (

{product.name}

${product.price.toFixed(2)}

))}
{cart.length > 0 && (

Your Cart

    {cart.map((item, idx) => (
  • {item.name}
    ${item.price.toFixed(2)} each
    updateQty(idx, Number(e.target.value) || 0)} className="w-16 text-center rounded" />
    ${(item.qty * item.price).toFixed(2)}
  • ))}
Total: ${cartTotal()}
)}

Create Your Own Sticker

Upload your design, pick a size and finish, and make it yours.

What Our Customers Say

{[1, 2, 3].map((t) => (
β€œAbsolutely love these stickers! Great quality and super cute designs.”
β˜…β˜…β˜…β˜…β˜…
- Happy Customer
))}

Join Our Sticker Club

Sign up for 10% off your first order & exclusive designs!

setEmail(e.target.value)} placeholder="Your email" className="px-4 py-2 rounded-l-lg text-black w-64" />
); }