const EditLostItemModal = ({ state, handlers }) => { const { selectedLostItemToEdit, showEditLostItemModal, setShowEditLostItemModal, categories, loading, } = state; const { handleUpdateLostItem } = handlers; // ✅ DEBUG: Log data saat modal dibuka React.useEffect(() => { if (selectedLostItemToEdit) { console.log("📋 Selected Lost Item Data:", selectedLostItemToEdit); console.log("🏷️ Category ID:", selectedLostItemToEdit.category_id); console.log("📦 Available Categories:", categories); } }, [selectedLostItemToEdit, categories]); if (!showEditLostItemModal || !selectedLostItemToEdit) return null; return ( setShowEditLostItemModal(false)} title="✏️ Edit Laporan Barang Hilang" size="large" >
{/* ✅ PERBAIKAN: Gunakan category_id, bukan category */} {/* ✅ DEBUGGING: Tampilkan nilai saat ini */} Current: {selectedLostItemToEdit.category} (ID:{" "} {selectedLostItemToEdit.category_id})