- {/* Item Image */}
-
-
- {imageLoading && (
-
- )}
-

-
- {item.reporter?.trust && (
-
-
-
- Trusted
-
-
- )}
-
-
- {/* Item Details */}
-
- {/* Status and Category Badges */}
-
-
- {statusText}
-
- {item.claimed && (
- Claimed
- )}
-
- {item.category || 'Uncategorized'}
-
-
- {/* Title */}
-
- {item.title || 'Untitled Item'}
-
- {/* Description */}
-
- {item.description || 'No description provided'}
-
- {/* Location and Date */}
-
-
-
- {item.location || 'Unknown location'}
-
- •
-
- 🕒 {formatDate(item.date)}
-
-
-
+
+ {/* Image Section */}
+
+ {imageLoading && (
+
+ )}
+

+
+
+ {/* Location and Date - Full width under image */}
+
+
+
+ {item.location || 'Unknown location'}
+
+
+ 🕒
+ {formatDate(item.date)}
+
+
+
+ {/* Content Section */}
+
+ {/* Title */}
+
+ {item.title}
+
+
+ {/* Description */}
+
+ {item.description || 'No description available'}
+
+
+ {/* Status and Category Tags - Stick to bottom */}
+
+
+ {statusText}
+
+ {item.category && (
+
+ {item.category}
+
+ )}
+ {item.claimed && (
+
+ Claimed
+
+ )}
+ {item.reporter?.trust && (
+
+ ✓ Verified
+
+ )}
@@ -157,10 +145,11 @@ ItemCard.propTypes = {
imageUrl: PropTypes.string,
kind: PropTypes.string,
category: PropTypes.string,
+ claimed: PropTypes.bool,
reporter: PropTypes.shape({
trust: PropTypes.bool
})
}).isRequired
};
-export default ItemCard;
+export default ItemCard;
\ No newline at end of file
diff --git a/frontend/src/pages/ItemDetail.js b/frontend/src/pages/ItemDetail.js
index 3ca67a7..72b3a0e 100644
--- a/frontend/src/pages/ItemDetail.js
+++ b/frontend/src/pages/ItemDetail.js
@@ -1,8 +1,7 @@
import React, { useEffect, useState, useCallback } from 'react';
import PropTypes from 'prop-types';
import { useParams, useNavigate, Link } from 'react-router-dom';
-import Badge from '../components/ui/Badge';
-import { ArrowLeft, ShieldCheck, MapPin } from '../components/ui/icons';
+import { ArrowLeft, MapPin } from '../components/ui/icons';
import { db } from '../firebase/config';
import { getAuth, onAuthStateChanged } from 'firebase/auth';
import {
@@ -259,21 +258,31 @@ const ItemDetailPage = () => {
className="rounded-lg border aspect-video object-cover"
/>
-
-
- {item.kind || item.status}
-
+ {/* Status and Category Tags */}
+
+
+ {item.kind?.charAt(0).toUpperCase() + item.kind?.slice(1) || 'Unknown'}
+
+ {item.category && (
+
+ {item.category}
+
+ )}
{item.claimed && (
- Claimed
+
+ Claimed
+
)}
-
- {item.category || item.type}
-
{userInfo?.trust && (
-
-
- Trusted
-
+
+ ✓ Verified
+
)}
{item.title}
diff --git a/frontend/src/pages/__tests__/ItemDetail.test.js b/frontend/src/pages/__tests__/ItemDetail.test.js
index 9802746..ab10027 100644
--- a/frontend/src/pages/__tests__/ItemDetail.test.js
+++ b/frontend/src/pages/__tests__/ItemDetail.test.js
@@ -153,7 +153,7 @@ describe('ItemDetailPage', () => {
});
};
- const assertItemStatusBadge = async (status = 'lost') => {
+ const assertItemStatusBadge = async (status = 'Lost') => {
await waitFor(() => {
expect(screen.getByText(status)).toBeInTheDocument();
});
@@ -262,14 +262,14 @@ describe('ItemDetailPage', () => {
test('displays item status badge correctly', async () => {
setupOnSnapshotMock();
renderItemDetailPage();
- await assertItemStatusBadge('lost');
+ await assertItemStatusBadge('Lost');
});
test('displays found item status badge correctly', async () => {
const foundItem = { ...mockItem, kind: 'found' };
setupOnSnapshotMock(foundItem);
renderItemDetailPage();
- await assertItemStatusBadge('found');
+ await assertItemStatusBadge('Found');
});
test('displays claimed badge when item is claimed', async () => {