import { useState } from "react"; const ITEMS = [ { id: "ASSET-00847", hil: "HL-BM-OF-S2-L1-BIN03", owner: "DVO77", ownerName: "Daniel", generosity: 94, name: "Porcelain Insulator Wheels (Set of 7)", category: "Antique Hardware", qty: 7, qtyAvailable: 3, status: "available_trade", provenance: "Salvaged from 1940s industrial loom, Wisconsin", condition: "Good โ€” minor chips on two", estimatedValue: 45, wants: ["Bakelite knobs", "vintage hardware", "vacuum tubes"], story: "Part of the old Hendricks loom collection. These were running looms in 1942.", image: "๐Ÿ”ฉ", heirloom: false, tags: ["antique", "hardware", "ceramic"], }, { id: "ASSET-01102", hil: "HL-GR-WK-N2-L2-BIN01", owner: "DVO77", ownerName: "Daniel", generosity: 94, name: "Bakelite Radio Knob Collection", category: "Vintage Electronics", qty: 23, qtyAvailable: 0, status: "brag", provenance: "1930sโ€“1950s radio salvage, various sources", condition: "Excellent โ€” full patina intact", estimatedValue: 180, wants: [], story: "Forty years of patient hunting at estate sales across three states. Some of these came off cathedral radios.", image: "๐Ÿ“ป", heirloom: true, tags: ["bakelite", "vintage", "radio", "electronics"], }, { id: "ASSET-01334", hil: "HL-BM-ST-E2-DWR04", owner: "TED42", ownerName: "Ted", generosity: 78, name: "Milwaukee 3/8\" Ratchet Set", category: "Hand Tools", qty: 1, qtyAvailable: 1, status: "available_loan", provenance: null, condition: "Very Good", estimatedValue: 65, wants: [], story: null, image: "๐Ÿ”ง", heirloom: false, tags: ["tools", "ratchet", "milwaukee"], }, { id: "KIT-00023", hil: "HL-BM-OF-N1-L1-BIN02", owner: "DVO77", ownerName: "Daniel", generosity: 94, name: "Beginner Soap Making Kit", category: "Hobby Kit", qty: 1, qtyAvailable: 1, status: "kit_library", provenance: null, condition: "Complete โ€” used twice", estimatedValue: 55, wants: ["Rock tumbler kit", "resin casting kit", "leatherworking starter"], story: "Got deep into cold process soap for about three weeks. Great kit, not my thing. Somebody's gonna love this.", image: "๐Ÿงผ", heirloom: false, tags: ["hobby", "soap", "crafts", "beginner"], }, { id: "KIT-00031", hil: "HL-GR-WK-S3-L0-F0", owner: "RITA55", ownerName: "Rita", generosity: 88, name: "Rock Tumbler + Rough Stone Collection", category: "Hobby Kit", qty: 1, qtyAvailable: 1, status: "kit_library", provenance: null, condition: "Good โ€” tumbler barrel has staining", estimatedValue: 80, wants: ["Soap making kit", "candle making", "anything crafty"], story: "My kids used this for two summers. Comes with about 4lbs of rough stones. Ready for a new adventure.", image: "๐Ÿชจ", heirloom: false, tags: ["hobby", "rocks", "tumbler", "kids"], }, { id: "ASSET-02201", hil: "HL-BM-MM-W2-L3-BIN05", owner: "DVO77", ownerName: "Daniel", generosity: 94, name: "Vintage Snap-On Tool Chest (1970s)", category: "Shop Equipment", qty: 1, qtyAvailable: 0, status: "brag", provenance: "Purchased from retiring machinist, 1998", condition: "Original red paint, all drawers smooth", estimatedValue: 1200, wants: [], story: "This chest has been in every shop I've ever had. Not going anywhere โ€” but if you make me a ridiculous offer, we can talk.", image: "๐Ÿ—„๏ธ", heirloom: true, tags: ["snap-on", "vintage", "tool chest", "shop"], }, { id: "ASSET-03310", hil: "HL-GR-WK-E1-L2-BIN03", owner: "BILL77", ownerName: "Bill", generosity: 61, name: "Oscilloscope โ€” Tektronix 465", category: "Test Equipment", qty: 1, qtyAvailable: 1, status: "available_sale", provenance: "University surplus, calibrated 2021", condition: "Excellent โ€” all probes included", estimatedValue: 220, wants: [], story: null, image: "๐Ÿ“ก", heirloom: false, tags: ["electronics", "test equipment", "oscilloscope"], }, ]; const STATUS_CONFIG = { brag: { label: "Brag Shelf", color: "#f59e0b", bg: "#451a03" }, available_trade: { label: "Trade Me", color: "#34d399", bg: "#022c22" }, available_loan: { label: "Borrow Me", color: "#60a5fa", bg: "#0c1a3a" }, available_sale: { label: "For Sale", color: "#f87171", bg: "#2d0a0a" }, kit_library: { label: "Kit Library", color: "#c084fc", bg: "#1a0533" }, legacy_mode: { label: "Legacy", color: "#e5e7eb", bg: "#111827" }, }; const FILTERS = ["all", "brag", "available_trade", "available_loan", "available_sale", "kit_library"]; function GenerosityBadge({ score }) { const color = score >= 85 ? "#34d399" : score >= 65 ? "#f59e0b" : "#f87171"; return (
G:{score}
); } function StatusPill({ status }) { const cfg = STATUS_CONFIG[status] || STATUS_CONFIG.brag; return ( {cfg.label} ); } function ItemCard({ item, onClick }) { const cfg = STATUS_CONFIG[item.status] || STATUS_CONFIG.brag; return (
onClick(item)} style={{ background: "linear-gradient(145deg, #1a1a2e 0%, #16213e 100%)", border: `1px solid ${cfg.color}33`, borderRadius: 12, padding: 20, cursor: "pointer", transition: "all 0.2s", position: "relative", overflow: "hidden", }} onMouseEnter={e => { e.currentTarget.style.border = `1px solid ${cfg.color}99`; e.currentTarget.style.transform = "translateY(-2px)"; e.currentTarget.style.boxShadow = `0 8px 32px ${cfg.color}22`; }} onMouseLeave={e => { e.currentTarget.style.border = `1px solid ${cfg.color}33`; e.currentTarget.style.transform = "translateY(0)"; e.currentTarget.style.boxShadow = "none"; }} > {item.heirloom && (
๐Ÿ‘‘
)}
{item.image}
{item.name}
{item.hil}
~${item.estimatedValue}
by {item.ownerName} {item.qtyAvailable > 0 && ( {item.qtyAvailable} avail. )}
{item.story && (
"{item.story}"
)}
); } function Modal({ item, onClose }) { const [action, setAction] = useState(null); const [message, setMessage] = useState(""); const [sent, setSent] = useState(false); const cfg = STATUS_CONFIG[item.status] || STATUS_CONFIG.brag; const handleSend = () => { setSent(true); setTimeout(() => { setSent(false); setAction(null); setMessage(""); }, 2500); }; return (
e.stopPropagation()} style={{ background: "linear-gradient(145deg, #0f172a, #1e293b)", border: `1px solid ${cfg.color}66`, borderRadius: 16, padding: 32, maxWidth: 560, width: "100%", boxShadow: `0 0 60px ${cfg.color}22`, maxHeight: "90vh", overflowY: "auto", }} >
{item.image}
{item.heirloom && ๐Ÿ‘‘ Heirloom}

{item.name}

{item.hil}
{[ ["Owner", item.ownerName], ["Condition", item.condition], ["Est. Value", `~$${item.estimatedValue}`], ["Category", item.category], ].map(([k, v]) => (
{k}
{v}
))}
{item.provenance && (
Provenance
{item.provenance}
)} {item.story && (
"{item.story}"
)} {item.wants?.length > 0 && (
Would Trade For
{item.wants.map(w => ( {w} ))}
)}
generosity score
{!sent && !action && (
{item.status === "brag" && ( )} {item.status === "available_trade" && ( )} {item.status === "available_loan" && ( )} {item.status === "available_sale" && ( )} {item.status === "kit_library" && ( <> )}
)} {action && !sent && (
{action} message to {item.ownerName}: