Create src/components/ResearchSpace.tsx
Browse files
src/components/ResearchSpace.tsx
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { FolderOpen, Calendar, ChevronRight, FileText, Plus } from 'lucide-react';
|
| 3 |
+
|
| 4 |
+
export const ResearchSpace = ({ projects, onSelectProject, t }) => {
|
| 5 |
+
return (
|
| 6 |
+
<div className="space-y-6">
|
| 7 |
+
<div className="flex justify-between items-center">
|
| 8 |
+
<div>
|
| 9 |
+
<h2 className="text-2xl font-bold text-slate-900">{t.navProjects || "المشاريع البحثية"}</h2>
|
| 10 |
+
<p className="text-slate-500 text-sm">إدارة وتنظيم أبحاثك في التراث المريدي</p>
|
| 11 |
+
</div>
|
| 12 |
+
<button className="flex items-center gap-2 bg-emerald-800 text-white px-4 py-2 rounded-xl text-sm hover:bg-emerald-700 transition">
|
| 13 |
+
<Plus className="w-4 h-4" />
|
| 14 |
+
مشروع جديد
|
| 15 |
+
</button>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
{projects.length === 0 ? (
|
| 19 |
+
<div className="bg-white border-2 border-dashed border-slate-200 rounded-3xl p-12 text-center">
|
| 20 |
+
<div className="bg-slate-50 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 21 |
+
<FolderOpen className="w-8 h-8 text-slate-300" />
|
| 22 |
+
</div>
|
| 23 |
+
<h3 className="text-lg font-bold text-slate-900 mb-2">لا توجد مشاريع نشطة</h3>
|
| 24 |
+
<p className="text-slate-500 max-w-sm mx-auto mb-6">
|
| 25 |
+
ابدأ بالبحث في "الباحث الذكي" وقم بتحويل محادثاتك إلى مشاريع بحثية منظمة.
|
| 26 |
+
</p>
|
| 27 |
+
</div>
|
| 28 |
+
) : (
|
| 29 |
+
<div className="grid gap-4">
|
| 30 |
+
{projects.map((project) => (
|
| 31 |
+
<div
|
| 32 |
+
key={project.id}
|
| 33 |
+
onClick={() => onSelectProject(project)}
|
| 34 |
+
className="bg-white p-5 rounded-2xl border border-slate-200 hover:border-emerald-500 cursor-pointer transition-all group flex items-center justify-between"
|
| 35 |
+
>
|
| 36 |
+
<div className="flex items-center gap-4">
|
| 37 |
+
<div className="w-12 h-12 bg-emerald-50 rounded-xl flex items-center justify-center text-emerald-700 group-hover:bg-emerald-600 group-hover:text-white transition-colors">
|
| 38 |
+
<FileText className="w-6 h-6" />
|
| 39 |
+
</div>
|
| 40 |
+
<div>
|
| 41 |
+
<h3 className="font-bold text-slate-900">{project.name}</h3>
|
| 42 |
+
<div className="flex items-center gap-3 text-xs text-slate-400 mt-1">
|
| 43 |
+
<span className="flex items-center gap-1">
|
| 44 |
+
<Calendar className="w-3 h-3" />
|
| 45 |
+
{new Date(project.createdAt).toLocaleDateString(undefined, { dateStyle: 'medium' })}
|
| 46 |
+
</span>
|
| 47 |
+
<span>•</span>
|
| 48 |
+
<span>{project.sources.length} مصادر</span>
|
| 49 |
+
</div>
|
| 50 |
+
</div>
|
| 51 |
+
</div>
|
| 52 |
+
<ChevronRight className="w-5 h-5 text-slate-300 group-hover:text-emerald-600 transition-colors" />
|
| 53 |
+
</div>
|
| 54 |
+
))}
|
| 55 |
+
</div>
|
| 56 |
+
)}
|
| 57 |
+
</div>
|
| 58 |
+
);
|
| 59 |
+
};
|