new dashboards

This commit is contained in:
Desktop
2025-11-14 04:58:56 +05:00
parent e99a96aa2d
commit 3eb712b2dd
3 changed files with 630 additions and 352 deletions

View File

@@ -17,7 +17,8 @@ import {
BoltIcon,
ArrowUpIcon,
ArrowDownIcon,
ArrowRightIcon
ArrowRightIcon,
PaperPlaneIcon
} from "../../icons";
import {
fetchTasks,
@@ -827,6 +828,135 @@ export default function WriterDashboard() {
</ComponentCard>
)}
{/* Writer Modules */}
<ComponentCard title="Writer Modules" desc="Access all content creation tools and features">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
{[
{
title: "Tasks",
description: "Content writing tasks and assignments",
icon: FileTextIcon,
color: "from-[#0693e3] to-[#0472b8]",
path: "/writer/tasks",
count: stats.tasks.total,
metric: `${stats.tasks.completed} completed`,
},
{
title: "Content",
description: "Generated content and drafts",
icon: PencilIcon,
color: "from-[#0bbf87] to-[#08966b]",
path: "/writer/content",
count: stats.content.total,
metric: `${stats.content.published} published`,
},
{
title: "Images",
description: "Generated images and assets",
icon: BoxIcon,
color: "from-[#ff7a00] to-[#cc5f00]",
path: "/writer/images",
count: stats.images.generated,
metric: `${stats.images.pending} pending`,
},
{
title: "Published",
description: "Published content and posts",
icon: PaperPlaneIcon,
color: "from-[#5d4ae3] to-[#3a2f94]",
path: "/writer/published",
count: stats.content.published,
metric: "View all published",
},
].map((module) => {
const Icon = module.icon;
return (
<Link
key={module.title}
to={module.path}
className="rounded-2xl border-2 border-slate-200 bg-white p-6 hover:shadow-xl hover:-translate-y-1 transition-all group"
>
<div className="flex items-start justify-between mb-4">
<div className={`inline-flex size-14 rounded-xl bg-gradient-to-br ${module.color} items-center justify-center text-white shadow-lg`}>
<Icon className="h-7 w-7" />
</div>
</div>
<h3 className="text-lg font-bold text-slate-900 mb-2">{module.title}</h3>
<p className="text-sm text-slate-600 mb-4">{module.description}</p>
<div className="flex items-center justify-between">
<div>
<div className="text-2xl font-bold text-slate-900">{module.count}</div>
<div className="text-xs text-slate-500">{module.metric}</div>
</div>
<ArrowRightIcon className="h-5 w-5 text-slate-400 group-hover:text-[#0693e3] group-hover:translate-x-1 transition" />
</div>
</Link>
);
})}
</div>
</ComponentCard>
{/* Quick Actions */}
<ComponentCard title="Quick Actions" desc="Common content creation tasks and shortcuts">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<Link
to="/writer/tasks"
className="flex items-center gap-4 p-4 rounded-lg border-2 border-slate-200 bg-white hover:border-[#0693e3] hover:shadow-md transition group"
>
<div className="size-12 rounded-lg bg-gradient-to-br from-[#0693e3] to-[#0472b8] flex items-center justify-center text-white">
<FileTextIcon className="h-6 w-6" />
</div>
<div className="flex-1">
<h4 className="font-semibold text-slate-900">Create Task</h4>
<p className="text-xs text-slate-600">New writing task</p>
</div>
<ArrowRightIcon className="h-5 w-5 text-slate-400 group-hover:text-[#0693e3] transition" />
</Link>
<Link
to="/writer/content"
className="flex items-center gap-4 p-4 rounded-lg border-2 border-slate-200 bg-white hover:border-[#0bbf87] hover:shadow-md transition group"
>
<div className="size-12 rounded-lg bg-gradient-to-br from-[#0bbf87] to-[#08966b] flex items-center justify-center text-white">
<PencilIcon className="h-6 w-6" />
</div>
<div className="flex-1">
<h4 className="font-semibold text-slate-900">Generate Content</h4>
<p className="text-xs text-slate-600">AI content creation</p>
</div>
<ArrowRightIcon className="h-5 w-5 text-slate-400 group-hover:text-[#0bbf87] transition" />
</Link>
<Link
to="/writer/images"
className="flex items-center gap-4 p-4 rounded-lg border-2 border-slate-200 bg-white hover:border-[#ff7a00] hover:shadow-md transition group"
>
<div className="size-12 rounded-lg bg-gradient-to-br from-[#ff7a00] to-[#cc5f00] flex items-center justify-center text-white">
<BoxIcon className="h-6 w-6" />
</div>
<div className="flex-1">
<h4 className="font-semibold text-slate-900">Generate Images</h4>
<p className="text-xs text-slate-600">Create visuals</p>
</div>
<ArrowRightIcon className="h-5 w-5 text-slate-400 group-hover:text-[#ff7a00] transition" />
</Link>
<Link
to="/writer/published"
className="flex items-center gap-4 p-4 rounded-lg border-2 border-slate-200 bg-white hover:border-[#5d4ae3] hover:shadow-md transition group"
>
<div className="size-12 rounded-lg bg-gradient-to-br from-[#5d4ae3] to-[#3a2f94] flex items-center justify-center text-white">
<PaperPlaneIcon className="h-6 w-6" />
</div>
<div className="flex-1">
<h4 className="font-semibold text-slate-900">Publish Content</h4>
<p className="text-xs text-slate-600">Publish to WordPress</p>
</div>
<ArrowRightIcon className="h-5 w-5 text-slate-400 group-hover:text-[#5d4ae3] transition" />
</Link>
</div>
</ComponentCard>
{/* Next Actions */}
{nextActions.length > 0 && (
<ComponentCard title="Next Actions" desc="Actionable items requiring attention">