diff options
| author | ertopogo <erwin.t.pombett@gmail.com> | 2026-01-18 20:32:59 +0100 |
|---|---|---|
| committer | ertopogo <erwin.t.pombett@gmail.com> | 2026-01-18 20:32:59 +0100 |
| commit | 09a949092c59856962e4a7d132bc5a5e76fe5e55 (patch) | |
| tree | 990d6b8f24ff9c6dbc0fcb15b5512067d09b17fd /storefront/pages/index.js | |
Initial commit: Medusa Backend + storefront + config
Diffstat (limited to 'storefront/pages/index.js')
| -rw-r--r-- | storefront/pages/index.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/storefront/pages/index.js b/storefront/pages/index.js new file mode 100644 index 0000000..fa4a592 --- /dev/null +++ b/storefront/pages/index.js @@ -0,0 +1,26 @@ +import { useProducts } from "medusa-react"
+
+export default function Home() {
+ const { products, isLoading } = useProducts()
+
+ return (
+ <div style={{ padding: "2rem", fontFamily: "sans-serif" }}>
+ <h1>Bienvenue sur la boutique Lucien-sens-bon</h1>
+ {isLoading && <span>Chargement des produits...</span>}
+
+ <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))", gap: "1rem" }}>
+ {products && products.map((product) => (
+ <div key={product.id} style={{ border: "1px solid #ccc", padding: "1rem", borderRadius: "8px" }}>
+ <h3>{product.title}</h3>
+ <p>{product.description}</p>
+ </div>
+ ))}
+ </div>
+
+ {!isLoading && !products?.length && (
+ <p>Aucun produit trouvé. Connectez-vous à l'admin pour en ajouter !</p>
+ )}
+ </div>
+ )
+}
+
|
