import { ArrowUpRight, BookOpen, Globe2, Shield, Sparkles, Swords } from 'lucide-react'; import { rarity, stats, type Article } from '../shared/protocol.ts'; import type { TestnetBlock } from '../shared/testnet.ts'; import { STARTER_ARTICLES } from '../shared/catalog.ts'; // hash is the RandomX proof hash for game stats; block.tokenId is NFT identity. export type CardData = { article: Article; hash: string; block?: TestnetBlock }; export const samples: CardData[] = STARTER_ARTICLES.map((article, i) => ({ article, hash: ['000eca7498a26d1908613726da6e869d7c9c936f4a461cb439ef24672b9a0008', '000b1a387a067a7d698677965ca1ca7b0eb5e590811431bdb9aad62268180001', '0008a4fa5893e9ddbd679cbcc7f0938706aa70aab8c8af42a4bc67a42520001', '0009a4fa5893e9ddbd679cbcc7f0938706aa70aab8c8af42a4bc67a42520020'][i] })); export function imageCredit(article: Article): string { if (!article.image) return article.url; const parts = new URL(article.image).pathname.split('/'); return `https://commons.wikimedia.org/wiki/File:${parts.includes('thumb') ? parts.at(-2)! : parts.at(-1)!}`; } export function Card({ card, onClick }: { card: CardData; onClick?: () => void }) { const { article, hash } = card; const tier = rarity(hash); const s = stats(hash); return ; }