--- import Layout from '../layouts/Main.astro'; import RarityIcon from "../components/RarityIcon.astro"; //import { eq } from 'drizzle-orm'; import { db } from '../db'; //import * as schema from '../db/schema.ts'; // Get some sample Pokemon data from the database //const pokemon = await db.select().from(schema.cards).where(eq(schema.cards.productLineName, "pokemon")).limit(256); const pokemon = await db.query.cards.findMany({ where: { productLineName: "pokemon" }, limit: 32, with: { prices: true, } }); const order = ["Near Mint", "Lightly Played", "Moderately Played", "Heavily Played", "Damaged"]; ---

Rigid's app thing

Inventory management placeholder
{pokemon.map((card) => (
{card.productName}
{card.productName}
{card.number}
{card.prices .slice() .sort((a, b) => order.indexOf(a.condition) - order.indexOf(b.condition)) .filter((price, index, arr) => arr.findIndex(p => p.condition === price.condition) === index ) .map((price) => (
{price.condition.split(' ').map((w) => w[0]).join('')}
${price.marketPrice}
))}
))}