const PublicLostItemsTab = ({ state, handlers }) => { const { publicLostItems, user } = state; const getStatusDisplay = (lostItem) => { const statusMap = { active: { label: "Aktif", color: "bg-green-600 text-white" }, claimed: { label: "Sedang Diklaim", color: "bg-yellow-600 text-white" }, resolved: { label: "Selesai", color: "bg-blue-600 text-white" }, }; return ( statusMap[lostItem.status] || { label: lostItem.status, color: "bg-gray-600 text-white", } ); }; const shouldShowFoundButton = (lostItem) => { return lostItem.user_id !== user.id && lostItem.status === "active"; }; const shouldShowClaimedInfo = (lostItem) => { return lostItem.status === "claimed" || lostItem.status === "resolved"; }; return (
Jika Anda menemukan barang yang cocok, klik "Saya Menemukan!" untuk memberitahu pemiliknya
{publicLostItems.length === 0 ? (🔭
Tidak ada barang hilang saat ini
{lostItem.category}
📍 Lokasi:{" "} {lostItem.location || "Tidak disebutkan"}
🎨 Warna:{" "} {lostItem.color || "Tidak disebutkan"}
📅 Tanggal Hilang:{" "} {new Date(lostItem.date_lost).toLocaleDateString("id-ID")}
📝 Deskripsi: {lostItem.description}
⏳ Sedang menunggu konfirmasi pemilik
✅ Barang sudah dikembalikan ke pemilik
📋 Ini laporan kehilangan Anda