diff --git a/admin/src/components/EmptyState.jsx b/admin/src/components/EmptyState.jsx new file mode 100644 index 00000000..aa8e0189 --- /dev/null +++ b/admin/src/components/EmptyState.jsx @@ -0,0 +1,44 @@ +const EmptyState = ({ + title = "No Data Found", + description = "There is currently no information available to display here.", + actionText, + onActionClick +}) => { + return ( +
+ {/* Centered Minimalist Icon */} +
+ + + +
+ + {/* Title & Description */} +

+ {title} +

+

+ {description} +

+ + {/* Optional Interactive CTA Button */} + {actionText && onActionClick && ( + + )} +
+ ); +}; + +export default EmptyState; \ No newline at end of file diff --git a/admin/src/pages/Home.jsx b/admin/src/pages/Home.jsx index ee3720cb..7d905d6c 100644 --- a/admin/src/pages/Home.jsx +++ b/admin/src/pages/Home.jsx @@ -10,6 +10,7 @@ import { FiTrendingUp, FiActivity, } from "react-icons/fi"; +import EmptyState from '../components/EmptyState'; function Home() { const [totalProducts, setTotalProducts] = useState(0); @@ -162,9 +163,10 @@ function Home() {
{activities.length === 0 ? ( -

- Waiting for user activity... -

+ ) : ( activities.map((activity, index) => (
+ className={`w-2 h-2 rounded-full ${ + activity.type === "login" + ? "bg-green-400" + : activity.type === "logout" + ? "bg-red-400" + : activity.type.includes("order") + ? "bg-purple-400" + : activity.type.includes("product") + ? "bg-blue-400" + : activity.type.includes("review") + ? "bg-yellow-400" + : activity.type.includes("cart") + ? "bg-cyan-400" + : "bg-pink-400" + }`} + >

{activity.user?.name || "User"} — {activity.action} diff --git a/frontend/src/components/EmptyState.jsx b/frontend/src/components/EmptyState.jsx new file mode 100644 index 00000000..aa8e0189 --- /dev/null +++ b/frontend/src/components/EmptyState.jsx @@ -0,0 +1,44 @@ +const EmptyState = ({ + title = "No Data Found", + description = "There is currently no information available to display here.", + actionText, + onActionClick +}) => { + return ( +

+ {/* Centered Minimalist Icon */} +
+ + + +
+ + {/* Title & Description */} +

+ {title} +

+

+ {description} +

+ + {/* Optional Interactive CTA Button */} + {actionText && onActionClick && ( + + )} +
+ ); +}; + +export default EmptyState; \ No newline at end of file