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 (
);
}
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.heirloom &&
๐ Heirloom}
{item.name}
{item.hil}
{[
["Owner", item.ownerName],
["Condition", item.condition],
["Est. Value", `~$${item.estimatedValue}`],
["Category", item.category],
].map(([k, v]) => (
))}
{item.provenance && (
Provenance
{item.provenance}
)}
{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}:
)}
{sent && (
โ Message sent to {item.ownerName}. Your AI will follow up.
)}
);
}
function btnStyle(color) {
return {
background: `${color}22`,
color: color,
border: `1px solid ${color}66`,
borderRadius: 8,
padding: "8px 16px",
fontSize: 12,
fontWeight: 700,
cursor: "pointer",
fontFamily: "monospace",
letterSpacing: 0.5,
};
}
function LegacyBanner({ onActivate }) {
const [confirming, setConfirming] = useState(false);
return (
โฐ๏ธ Legacy Mode
Activating will flip all Brag + Private items to Available for Sale and open the estate auction.
{!confirming ? (
) : (
Are you sure?
)}
);
}
export default function HILExchange() {
const [filter, setFilter] = useState("all");
const [selected, setSelected] = useState(null);
const [legacyActive, setLegacyActive] = useState(false);
const [items, setItems] = useState(ITEMS);
const [search, setSearch] = useState("");
const activateLegacy = () => {
setLegacyActive(true);
setItems(prev => prev.map(item =>
["brag", "private"].includes(item.status)
? { ...item, status: "legacy_mode" }
: item
));
};
const filtered = items.filter(item => {
const matchFilter = filter === "all" || item.status === filter;
const matchSearch = !search ||
item.name.toLowerCase().includes(search.toLowerCase()) ||
item.tags.some(t => t.includes(search.toLowerCase())) ||
item.ownerName.toLowerCase().includes(search.toLowerCase());
return matchFilter && matchSearch;
});
return (
{/* Header */}
HIL SYSTEM v5.1
The Exchange
Trade ยท Borrow ยท Brag ยท Auction ยท Kit Library
{legacyActive && (
โ Legacy Mode active โ all brag items are now available. Estate auction can be launched.
)}
{/* Search + Filter */}
setSearch(e.target.value)}
placeholder="Search items, tags, owners..."
style={{
background: "#0f172a", border: "1px solid #1e293b",
borderRadius: 8, padding: "8px 14px", color: "#e2e8f0",
fontSize: 13, flex: "1 1 200px", minWidth: 0,
}}
/>
{FILTERS.map(f => {
const cfg = STATUS_CONFIG[f];
const active = filter === f;
return (
);
})}
{/* Stats Bar */}
{Object.entries(STATUS_CONFIG).map(([key, cfg]) => {
const count = items.filter(i => i.status === key).length;
if (!count) return null;
return (
);
})}
{/* Grid */}
{filtered.map(item => (
))}
{filtered.length === 0 && (
No items match that filter.
)}
{/* Footer */}
HIL Exchange ยท Open Source ยท Nothing is Lost. Everything is Logic.
{selected &&
setSelected(null)} />}
);
}