diff --git a/dashboard/src/components/dashboard/MiniEventFeed.jsx b/dashboard/src/components/dashboard/MiniEventFeed.jsx index 88a4c38..d92d1b5 100644 --- a/dashboard/src/components/dashboard/MiniEventFeed.jsx +++ b/dashboard/src/components/dashboard/MiniEventFeed.jsx @@ -36,33 +36,45 @@ const METRIC_IDS = { const EVENT_TYPES = { [METRIC_IDS.PLACED_ORDER]: { label: "Order Placed", - color: "bg-green-500 dark:bg-green-600", - textColor: "text-green-600 dark:text-green-400", + color: "bg-green-300", + textColor: "text-green-100", + iconColor: "text-green-900", + gradient: "from-green-900 to-green-800", }, [METRIC_IDS.SHIPPED_ORDER]: { label: "Order Shipped", - color: "bg-blue-500 dark:bg-blue-600", - textColor: "text-blue-600 dark:text-blue-400", + color: "bg-blue-300", + textColor: "text-blue-100", + iconColor: "text-blue-900", + gradient: "from-blue-900 to-blue-800", }, [METRIC_IDS.ACCOUNT_CREATED]: { label: "New Account", - color: "bg-purple-500 dark:bg-purple-600", - textColor: "text-purple-600 dark:text-purple-400", + color: "bg-purple-300", + textColor: "text-purple-100", + iconColor: "text-purple-900", + gradient: "from-purple-900 to-purple-800", }, [METRIC_IDS.CANCELED_ORDER]: { label: "Order Canceled", - color: "bg-red-500 dark:bg-red-600", - textColor: "text-red-600 dark:text-red-400", + color: "bg-red-300", + textColor: "text-red-100", + iconColor: "text-red-900", + gradient: "from-red-900 to-red-800", }, [METRIC_IDS.PAYMENT_REFUNDED]: { label: "Payment Refunded", - color: "bg-orange-500 dark:bg-orange-600", - textColor: "text-orange-600 dark:text-orange-400", + color: "bg-orange-300", + textColor: "text-orange-100", + iconColor: "text-orange-900", + gradient: "from-orange-900 to-orange-800", }, [METRIC_IDS.NEW_BLOG_POST]: { label: "New Blog Post", - color: "bg-indigo-500 dark:bg-indigo-600", - textColor: "text-indigo-600 dark:text-indigo-400", + color: "bg-indigo-300", + textColor: "text-indigo-100", + iconColor: "text-indigo-900", + gradient: "from-indigo-900 to-indigo-800", }, }; @@ -77,22 +89,25 @@ const EVENT_ICONS = { // Loading State Component const LoadingState = () => ( -
- {[...Array(4)].map((_, i) => ( - - -
- -
- - -
+
+ {[...Array(6)].map((_, i) => ( + + +
+ + +
+
+
+
- +
- - + +
+ +
@@ -102,16 +117,13 @@ const LoadingState = () => ( // Empty State Component const EmptyState = () => ( - - -
- + + +
+
-

- No activity yet -

-

- Recent activity will appear here as it happens +

+ No recent activity

@@ -124,52 +136,33 @@ const EventCard = ({ event }) => { const Icon = EVENT_ICONS[event.metric_id] || Package; const details = event.event_properties || {}; - const getBgGradient = (type) => { - switch (type) { - case METRIC_IDS.PLACED_ORDER: - return 'from-green-900 to-green-800'; - case METRIC_IDS.SHIPPED_ORDER: - return 'from-blue-900 to-blue-800'; - case METRIC_IDS.ACCOUNT_CREATED: - return 'from-purple-900 to-purple-800'; - case METRIC_IDS.CANCELED_ORDER: - return 'from-red-900 to-red-800'; - case METRIC_IDS.PAYMENT_REFUNDED: - return 'from-orange-900 to-orange-800'; - case METRIC_IDS.NEW_BLOG_POST: - return 'from-indigo-900 to-indigo-800'; - default: - return 'from-gray-900 to-gray-800'; - } - }; - return ( - +
- + {eventType.label} {event.datetime && ( - + {format(new Date(event.datetime), "h:mm a")} )}
-
- +
+
{event.metric_id === METRIC_IDS.PLACED_ORDER && ( <> -
+
{details.ShippingName}
-
+
#{details.OrderId} • {formatCurrency(details.TotalAmount)}
@@ -246,24 +239,23 @@ const EventCard = ({ event }) => { {event.metric_id === METRIC_IDS.SHIPPED_ORDER && ( <> -
+
{details.ShippingName}
-
+
#{details.OrderId} • {formatShipMethodSimple(details.ShipMethod)}
- )} {event.metric_id === METRIC_IDS.ACCOUNT_CREATED && ( <> -
+
{details.FirstName} {details.LastName}
-
+
{details.EmailAddress}
@@ -271,15 +263,15 @@ const EventCard = ({ event }) => { {event.metric_id === METRIC_IDS.CANCELED_ORDER && ( <> -
+
{details.ShippingName}
-
+
#{details.OrderId} • {formatCurrency(details.TotalAmount)}
-
+
{details.CancelReason}
@@ -287,15 +279,15 @@ const EventCard = ({ event }) => { {event.metric_id === METRIC_IDS.PAYMENT_REFUNDED && ( <> -
+
{details.ShippingName}
-
+
#{details.FromOrder} • {formatCurrency(details.PaymentAmount)}
-
+
via {details.PaymentName}
@@ -303,10 +295,10 @@ const EventCard = ({ event }) => { {event.metric_id === METRIC_IDS.NEW_BLOG_POST && ( <> -
+
{details.title}
-
+
{details.description}