'use client'; import type { LootInventory } from '@/lib/game/types'; // For backward compatibility type LootInventoryType = LootInventory; import { LOOT_DROPS } from '@/lib/game/data/loot-drops'; import { RARITY_CSS_VAR, RARITY_GLOW_CSS_VAR } from './types'; import { Sparkles, Trash2 } from 'lucide-react'; import { ActionButton } from '@/components/ui/action-button'; interface MaterialItemProps { materialId: string; count: number; onDelete?: (materialId: string) => void; } export function MaterialItem({ materialId, count, onDelete }: MaterialItemProps) { const drop = LOOT_DROPS[materialId]; if (!drop) return null; const rarityColor = RARITY_CSS_VAR[drop.rarity] || 'var(--rarity-common)'; const rarityGlow = RARITY_GLOW_CSS_VAR[drop.rarity] || 'var(--rarity-common-glow)'; return (
{drop.name}
x{count}
{drop.rarity}
{onDelete && ( onDelete(materialId)} aria-label={`Delete ${drop.name}`} > )}
); } interface MaterialsSectionProps { materials: [string, number][]; onDeleteMaterial?: (materialId: string) => void; } export function MaterialsSection({ materials, onDeleteMaterial }: MaterialsSectionProps) { if (materials.length === 0) return null; return (
Materials
{materials.map(([id, count]) => ( ))}
); }