-
+
-
diff --git a/components/dashboard/content.tsx b/components/dashboard/content.tsx
index f8f9c62..50ca07b 100644
--- a/components/dashboard/content.tsx
+++ b/components/dashboard/content.tsx
@@ -25,7 +25,7 @@ interface ContentProps {
interface TopProduct {
id: string;
name: string;
- price: number;
+ price: number | number[];
image: string;
count: number;
revenue: number;
@@ -73,7 +73,7 @@ export default function Content({ username, orderStats }: ContentProps) {
{greeting}, {username}!
-
+
"{randomQuote.text}" — {randomQuote.author}
@@ -181,14 +181,13 @@ export default function Content({ username, orderStats }: ContentProps) {
{product.name}
- £{(Number(product.price) || 0).toFixed(2)}
-
- ID: {product.id.slice(-6)}
+ £{(Number(Array.isArray(product.price) ? product.price[0] : product.price) || 0).toFixed(2)}
{product.count}
-
Units Sold
+
Units Sold
+
£{product.revenue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
))}
diff --git a/components/notifications/UnifiedNotifications.tsx b/components/notifications/UnifiedNotifications.tsx
index 1a8cfe0..c19eb6d 100644
--- a/components/notifications/UnifiedNotifications.tsx
+++ b/components/notifications/UnifiedNotifications.tsx
@@ -18,7 +18,7 @@ import { useNotifications } from "@/lib/notification-context";
export default function UnifiedNotifications() {
const router = useRouter();
const [activeTab, setActiveTab] = useState
("all");
-
+
// Get notification state from context
const {
unreadCounts,
@@ -33,11 +33,11 @@ export default function UnifiedNotifications() {
const handleChatClick = (chatId: string) => {
router.push(`/dashboard/chats/${chatId}`);
};
-
+
const handleOrderClick = (orderId: string) => {
router.push(`/dashboard/orders/${orderId}`);
};
-
+
// Format the price as currency
const formatPrice = (price: number) => {
return `£${price.toFixed(2)}`;
@@ -49,8 +49,8 @@ export default function UnifiedNotifications() {
-
+
- All
+ All
{totalNotifications > 0 && (
{totalNotifications}
@@ -87,7 +87,7 @@ export default function UnifiedNotifications() {
)}
-
+
{totalNotifications === 0 ? (
@@ -102,7 +102,7 @@ export default function UnifiedNotifications() {
Unread Messages
{Object.entries(unreadCounts.chatCounts).slice(0, 3).map(([chatId, count]) => (
- handleChatClick(chatId)}
@@ -130,15 +130,15 @@ export default function UnifiedNotifications() {
)}
>
)}
-
+
{/* Orders Section */}
{newOrders.length > 0 && (
<>
New Paid Orders
-
{newOrders.slice(0, 3).map((order) => (
- handleOrderClick(order._id)}
@@ -178,7 +178,7 @@ export default function UnifiedNotifications() {
)}
-
+
{unreadCounts.totalUnread === 0 ? (
@@ -188,7 +188,7 @@ export default function UnifiedNotifications() {
<>
{Object.entries(unreadCounts.chatCounts).map(([chatId, count]) => (
- handleChatClick(chatId)}
@@ -211,8 +211,8 @@ export default function UnifiedNotifications() {
))}
-