diff --git a/client/package-lock.json b/client/package-lock.json
index 3de2066..62002c9 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -45,7 +45,7 @@
"react-dom": "^18.2.0",
"react-google-recaptcha": "^3.1.0",
"react-hot-toast": "^2.4.1",
- "react-icons": "^5.0.1",
+ "react-icons": "^5.3.0",
"react-phone-input-2": "^2.15.1",
"react-phone-number-input": "^3.3.10",
"react-quill": "^2.0.0",
@@ -6517,7 +6517,8 @@
},
"node_modules/react-icons": {
"version": "5.3.0",
- "license": "MIT",
+ "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.3.0.tgz",
+ "integrity": "sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==",
"peerDependencies": {
"react": "*"
}
diff --git a/client/package.json b/client/package.json
index d4a1f73..55fb2f1 100644
--- a/client/package.json
+++ b/client/package.json
@@ -47,7 +47,7 @@
"react-dom": "^18.2.0",
"react-google-recaptcha": "^3.1.0",
"react-hot-toast": "^2.4.1",
- "react-icons": "^5.0.1",
+ "react-icons": "^5.3.0",
"react-phone-input-2": "^2.15.1",
"react-phone-number-input": "^3.3.10",
"react-quill": "^2.0.0",
diff --git a/client/src/component/Dashboard.jsx b/client/src/component/Dashboard.jsx
index d80c97c..d738d21 100644
--- a/client/src/component/Dashboard.jsx
+++ b/client/src/component/Dashboard.jsx
@@ -1,103 +1,183 @@
// import React from 'react';
-import PropTypes from "prop-types";
-
-
+import { FaUsers, FaMicroblog } from 'react-icons/fa';
+import { PiEyesDuotone } from 'react-icons/pi';
-const InsightCard = ({ icon, title, count, progress, color }) => (
-
-
-
- {icon}
-
-
-
{title}
- {count}
-
-
-
-
-
-
- {progress}
-
-
-
-
Last 24 Hours
-
-);
-
-const PostCard = ({ post }) => (
-
-
{post.title}
-
{post.content}
-
{post.date}
-
-);
+import PropTypes from "prop-types";
-const Dashboard = () => {
- const posts=[
- {id:1,title:"title1"},
- ]
- // Placeholder data; replace with actual data from backend if needed.
- const insightsData = [
- { icon: 'trending_up', title: 'Total Views', count: '100', progress: '80%', color: 'bg-coral' },
- { icon: 'local_mall', title: 'New Users', count: '323', progress: '50%', color: 'bg-red-400' },
- { icon: 'stacked_line_chart', title: 'Total Posts', count: '12', progress: '90%', color: 'bg-green-400' },
+const Dashboard = ({ mode }) => {
+ const isDarkMode = mode === 'dark';
+ const blogs = [
+ { id: 1, title: 'Understanding React', author: 'John Doe', category: 'Web Development' },
+ { id: 2, title: 'CSS Tips and Tricks', author: 'Jane Smith', category: 'Design' },
+ { id: 3, title: 'JavaScript Basics', author: 'Alice Johnson', category: 'Programming' },
];
+ const handleDelete = (id) => {
+ console.log(`Blog with id ${id} deleted`);
+ };
+
return (
-
+
{/* Header */}
{/* Insights */}
- {insightsData.map((item, index) => (
-
- ))}
+
+
+
+
+
+
+
Total Views
+ 100
+
+
+
+
Last 24 Hours
+
+
+
+
+
+
+
+
+
New Users
+ 323
+
+
+
+
Last 24 Hours
+
+
+
+
+
+
+
+
+
Total Posts
+ 12
+
+
+
+
Last 24 Hours
+
- {/* Recent Posts */}
+ {/* Blog Table */}
- Recent Posts
-
- {posts && posts.length > 0 ? (
- posts.map((post, index) =>
)
- ) : (
-
No posts available.
- )}
-
- Show All
+ Blog Posts
+
+
+
+ Title |
+ Author |
+ Category |
+ Actions |
+
+
+
+ {blogs.map((blog) => (
+
+ {blog.title} |
+ {blog.author} |
+ {blog.category} |
+
+
+ |
+
+ ))}
+
+
+
+ Show All
+
);
};
-PostCard.propTypes = {
- post: PropTypes.string.isRequired,
-};
Dashboard.propTypes = {
- post: PropTypes.string.isRequired,
-};
-InsightCard.propTypes = {
- post: PropTypes.string.isRequired,
- icon: PropTypes.string.isRequired,
- title: PropTypes.string.isRequired,
- count: PropTypes.string.isRequired,
- progress: PropTypes.string.isRequired,
- color: PropTypes.string.isRequired
+ mode: PropTypes.string, // Function to notify parent about profile update
};
export default Dashboard;