TheBird

Home.jsx

1.6 kB · jsx · 38 lines

1import { SHOP } from "../config/shop.ts";2import { DesignCard, DesignGrid } from "./Designs.jsx";3import { Life } from "../components/Life.jsx";4import { ProductCard } from "../components/ProductCard.jsx";5import { ProductGrid } from "../components/ProductGrid.jsx";6import { Strip } from "../components/Strip.jsx";78export function Home({ designs = [], sections, fresh = null, now }) {9  return (10    <>11      {fresh ? (12        <section className="wrap home-row" aria-labelledby="fresh">13          <Strip id="fresh" title="Just Generated" href={`${SHOP}?design=${fresh.design}`} more={`All ${fresh.count} products`}>14            <Life born={fresh.released} now={now} />15          </Strip>16          <div className="grid">17            <DesignCard design={fresh} life={false} now={now} />18            {fresh.products.map((product, i) => (19              <ProductCard key={product.key} product={product} eager={i < 3} life={false} now={now} />20            ))}21          </div>22        </section>23      ) : null}24      {designs.length ? (25        <section className="wrap home-row" aria-labelledby="designs">26          <Strip id="designs" title="Designs" href={`${SHOP}designs/`} more="All designs" />27          <DesignGrid designs={designs} now={now} />28        </section>29      ) : null}30      {sections.map((one) => (31        <section key={one.slug} className="wrap home-row" aria-labelledby={one.slug}>32          <Strip id={one.slug} title={one.name} href={`${SHOP}${one.slug}/`} more={`All ${one.name}`} />33          <ProductGrid products={one.products} now={now} />34        </section>35      ))}36    </>37  );38}