AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shop.tsx 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { useStorefront } from '../context';
  2. import { ProductCard } from '../product-card';
  3. import { storefrontText } from '../text';
  4. import { Container } from '../ui';
  5. /** The full shop: every product shoppers may see. Built by us, in the store's colours and fonts. */
  6. export function ShopPage() {
  7. const { products, language } = useStorefront();
  8. const t = storefrontText(language);
  9. return (
  10. <main className="py-12 md:py-16">
  11. <Container>
  12. <h1 className="sf-heading text-4xl font-semibold sm:text-5xl">
  13. {t.allProducts}
  14. </h1>
  15. <p className="mt-3 text-sm text-(--sf-muted)">
  16. {products.length > 0
  17. ? t.productCount(products.length)
  18. : t.noProducts}
  19. </p>
  20. {products.length > 0 && (
  21. <ul className="mt-10 grid grid-cols-2 gap-x-5 gap-y-10 md:grid-cols-3 lg:grid-cols-4">
  22. {products.map((product, index) => (
  23. <li key={product.id}>
  24. <ProductCard product={product} seed={index} />
  25. </li>
  26. ))}
  27. </ul>
  28. )}
  29. </Container>
  30. </main>
  31. );
  32. }