Demock folder components
This commit is contained in:
parent
eb27ec9df9
commit
30f00f6991
@ -188,14 +188,7 @@ export default function DocumentsPage() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const [folders] = useState([
|
const [folders] = useState([
|
||||||
{ id: "contracts", name: "Contrats" },
|
{ id: "general", name: "Général" },
|
||||||
{ id: "reports", name: "Rapports" },
|
|
||||||
{ id: "projects", name: "Projets" },
|
|
||||||
{ id: "finance", name: "Finance" },
|
|
||||||
{ id: "policies", name: "Politiques" },
|
|
||||||
{ id: "training", name: "Formation" },
|
|
||||||
{ id: "assets", name: "Assets" },
|
|
||||||
{ id: "archives", name: "Archives" },
|
|
||||||
])
|
])
|
||||||
|
|
||||||
const [users] = useState<UserWithRoles[]>([
|
const [users] = useState<UserWithRoles[]>([
|
||||||
@ -205,8 +198,7 @@ export default function DocumentsPage() {
|
|||||||
email: "marie.dubois@company.com",
|
email: "marie.dubois@company.com",
|
||||||
avatar: "MD",
|
avatar: "MD",
|
||||||
folderRoles: {
|
folderRoles: {
|
||||||
contracts: { role: "owner", assignedDate: new Date("2024-01-01") },
|
general: { role: "owner", assignedDate: new Date("2024-01-01") },
|
||||||
finance: { role: "editor", assignedDate: new Date("2024-01-05") },
|
|
||||||
},
|
},
|
||||||
spaceRole: "manager",
|
spaceRole: "manager",
|
||||||
spaceRoles: {
|
spaceRoles: {
|
||||||
@ -220,8 +212,7 @@ export default function DocumentsPage() {
|
|||||||
email: "sophie.laurent@company.com",
|
email: "sophie.laurent@company.com",
|
||||||
avatar: "SL",
|
avatar: "SL",
|
||||||
folderRoles: {
|
folderRoles: {
|
||||||
reports: { role: "owner", assignedDate: new Date("2024-01-02") },
|
general: { role: "editor", assignedDate: new Date("2024-01-02") },
|
||||||
projects: { role: "contributor", assignedDate: new Date("2024-01-10") },
|
|
||||||
},
|
},
|
||||||
spaceRole: "user",
|
spaceRole: "user",
|
||||||
spaceRoles: {
|
spaceRoles: {
|
||||||
@ -235,8 +226,7 @@ export default function DocumentsPage() {
|
|||||||
email: "jean.martin@company.com",
|
email: "jean.martin@company.com",
|
||||||
avatar: "JM",
|
avatar: "JM",
|
||||||
folderRoles: {
|
folderRoles: {
|
||||||
projects: { role: "owner", assignedDate: new Date("2024-01-03") },
|
general: { role: "viewer", assignedDate: new Date("2024-01-03") },
|
||||||
reports: { role: "viewer", assignedDate: new Date("2024-01-15") },
|
|
||||||
},
|
},
|
||||||
spaceRole: "user",
|
spaceRole: "user",
|
||||||
spaceRoles: {
|
spaceRoles: {
|
||||||
@ -250,8 +240,7 @@ export default function DocumentsPage() {
|
|||||||
email: "pierre.durand@company.com",
|
email: "pierre.durand@company.com",
|
||||||
avatar: "PD",
|
avatar: "PD",
|
||||||
folderRoles: {
|
folderRoles: {
|
||||||
training: { role: "owner", assignedDate: new Date("2024-01-04") },
|
general: { role: "contributor", assignedDate: new Date("2024-01-04") },
|
||||||
policies: { role: "validator", assignedDate: new Date("2024-01-08") },
|
|
||||||
},
|
},
|
||||||
spaceRole: "user",
|
spaceRole: "user",
|
||||||
spaceRoles: {
|
spaceRoles: {
|
||||||
|
|||||||
@ -74,7 +74,7 @@ interface FolderData {
|
|||||||
favorite: boolean
|
favorite: boolean
|
||||||
storageType: "temporary" | "permanent"
|
storageType: "temporary" | "permanent"
|
||||||
status: "active" | "archived" | "pending" | "completed" | "validated"
|
status: "active" | "archived" | "pending" | "completed" | "validated"
|
||||||
type: "contracts" | "reports" | "projects" | "finance" | "hr" | "marketing" | "legal" | "general"
|
type: string
|
||||||
expectedDocuments: Array<{
|
expectedDocuments: Array<{
|
||||||
name: string
|
name: string
|
||||||
required: boolean
|
required: boolean
|
||||||
@ -151,7 +151,7 @@ interface Role {
|
|||||||
level: "folder" | "space" | "global"
|
level: "folder" | "space" | "global"
|
||||||
}
|
}
|
||||||
|
|
||||||
type FolderType = "contrat" | "projet" | "rapport" | "finance" | "rh" | "marketing";
|
type FolderType = string;
|
||||||
|
|
||||||
export default function FoldersPage() {
|
export default function FoldersPage() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -392,265 +392,7 @@ export default function FoldersPage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Simuler le chargement des dossiers
|
// Simuler le chargement des dossiers
|
||||||
const loadFolders = () => {
|
const loadFolders = () => {
|
||||||
const mockFolders: FolderData[] = [
|
const mockFolders: FolderData[] = []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "Contrats",
|
|
||||||
description: "Tous les contrats clients et fournisseurs",
|
|
||||||
documentsCount: 45,
|
|
||||||
subfoldersCount: 3,
|
|
||||||
size: "125 MB",
|
|
||||||
created: new Date("2024-01-01T10:00:00"),
|
|
||||||
modified: new Date("2024-01-15T14:30:00"),
|
|
||||||
owner: "Marie Dubois",
|
|
||||||
access: "shared",
|
|
||||||
members: ["Marie Dubois", "Jean Martin", "Sophie Laurent"],
|
|
||||||
tags: ["juridique", "contrats", "clients"],
|
|
||||||
color: "blue",
|
|
||||||
favorite: true,
|
|
||||||
storageType: "permanent",
|
|
||||||
status: "active",
|
|
||||||
type: "contracts",
|
|
||||||
expectedDocuments: [
|
|
||||||
{ name: "Contrat cadre", required: true, assignedRole: "owner", status: "received" },
|
|
||||||
{ name: "Conditions générales", required: true, assignedRole: "validator", status: "received" },
|
|
||||||
{ name: "Annexes techniques", required: false, assignedRole: "editor", status: "missing" },
|
|
||||||
{ name: "Certificat d'assurance", required: true, assignedRole: "contributor", status: "pending" },
|
|
||||||
],
|
|
||||||
activity: [
|
|
||||||
{ user: "Marie Dubois", action: "ajouté", item: "Contrat_ABC.pdf", time: "Il y a 2h" },
|
|
||||||
{ user: "Jean Martin", action: "modifié", item: "Contrat_XYZ.pdf", time: "Il y a 5h" },
|
|
||||||
],
|
|
||||||
permissions: {
|
|
||||||
canView: true,
|
|
||||||
canEdit: true,
|
|
||||||
canDelete: true,
|
|
||||||
canInvite: true,
|
|
||||||
canArchive: false,
|
|
||||||
canAnalyze: true,
|
|
||||||
},
|
|
||||||
temporaryStorageConfig: {
|
|
||||||
duration: 90,
|
|
||||||
dataUsage: "Contrats clients et négociations commerciales",
|
|
||||||
thirdPartyAccess: "Avocats externes, clients contractants",
|
|
||||||
},
|
|
||||||
documents: [
|
|
||||||
{ id: "doc1", name: "Contrat_ABC.pdf", hasCertificate: true, certificateId: "CERT-DOC-001" },
|
|
||||||
{ id: "doc2", name: "Contrat_XYZ.pdf", hasCertificate: true, certificateId: "CERT-DOC-002" },
|
|
||||||
{ id: "doc3", name: "Annexe_A.pdf", hasCertificate: false },
|
|
||||||
{ id: "doc4", name: "Conditions_Generales.pdf", hasCertificate: true, certificateId: "CERT-DOC-003" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "Rapports",
|
|
||||||
description: "Rapports mensuels et analyses",
|
|
||||||
documentsCount: 28,
|
|
||||||
subfoldersCount: 2,
|
|
||||||
size: "89 MB",
|
|
||||||
created: new Date("2024-01-05T09:15:00"),
|
|
||||||
modified: new Date("2024-01-14T16:45:00"),
|
|
||||||
owner: "Sophie Laurent",
|
|
||||||
access: "private",
|
|
||||||
members: ["Sophie Laurent", "Pierre Durand"],
|
|
||||||
tags: ["rapports", "analyse", "mensuel"],
|
|
||||||
color: "green",
|
|
||||||
favorite: false,
|
|
||||||
storageType: "temporary",
|
|
||||||
status: "pending",
|
|
||||||
type: "reports",
|
|
||||||
expectedDocuments: [
|
|
||||||
{ name: "Rapport mensuel", required: true, assignedRole: "owner", status: "received" },
|
|
||||||
{ name: "Analyse KPI", required: true, assignedRole: "editor", status: "missing" },
|
|
||||||
{ name: "Graphiques", required: false, assignedRole: "contributor", status: "received" },
|
|
||||||
],
|
|
||||||
activity: [
|
|
||||||
{ user: "Sophie Laurent", action: "créé", item: "Rapport_Nov.docx", time: "Il y a 1j" },
|
|
||||||
{ user: "Pierre Durand", action: "consulté", item: "Analyse_Q4.xlsx", time: "Il y a 2j" },
|
|
||||||
],
|
|
||||||
permissions: {
|
|
||||||
canView: true,
|
|
||||||
canEdit: true,
|
|
||||||
canDelete: true,
|
|
||||||
canInvite: true,
|
|
||||||
canArchive: true,
|
|
||||||
canAnalyze: true,
|
|
||||||
},
|
|
||||||
temporaryStorageConfig: {
|
|
||||||
duration: 30,
|
|
||||||
dataUsage: "Analyses de performance et rapports internes",
|
|
||||||
thirdPartyAccess: "Consultants externes, auditeurs",
|
|
||||||
},
|
|
||||||
documents: [
|
|
||||||
{ id: "doc5", name: "Rapport_Nov.docx", hasCertificate: true, certificateId: "CERT-DOC-004" },
|
|
||||||
{ id: "doc6", name: "Analyse_Q4.xlsx", hasCertificate: false },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "Projets",
|
|
||||||
description: "Documentation des projets en cours",
|
|
||||||
documentsCount: 67,
|
|
||||||
subfoldersCount: 8,
|
|
||||||
size: "234 MB",
|
|
||||||
created: new Date("2023-12-15T11:30:00"),
|
|
||||||
modified: new Date("2024-01-15T09:20:00"),
|
|
||||||
owner: "Jean Martin",
|
|
||||||
access: "shared",
|
|
||||||
members: ["Jean Martin", "Marie Dubois", "Sophie Laurent", "Pierre Durand"],
|
|
||||||
tags: ["projets", "développement", "documentation"],
|
|
||||||
color: "purple",
|
|
||||||
favorite: true,
|
|
||||||
storageType: "temporary",
|
|
||||||
status: "active",
|
|
||||||
type: "projects",
|
|
||||||
expectedDocuments: [
|
|
||||||
{ name: "Cahier des charges", required: true, assignedRole: "owner", status: "received" },
|
|
||||||
{ name: "Spécifications techniques", required: true, assignedRole: "editor", status: "received" },
|
|
||||||
{ name: "Planning projet", required: true, assignedRole: "validator", status: "received" },
|
|
||||||
{ name: "Budget prévisionnel", required: true, assignedRole: "contributor", status: "missing" },
|
|
||||||
],
|
|
||||||
activity: [
|
|
||||||
{ user: "Jean Martin", action: "partagé", item: "Specs_Alpha.pdf", time: "Il y a 3h" },
|
|
||||||
{ user: "Marie Dubois", action: "commenté", item: "Design_Beta.figma", time: "Il y a 6h" },
|
|
||||||
],
|
|
||||||
permissions: {
|
|
||||||
canView: true,
|
|
||||||
canEdit: true,
|
|
||||||
canDelete: true,
|
|
||||||
canInvite: true,
|
|
||||||
canArchive: true,
|
|
||||||
canAnalyze: true,
|
|
||||||
},
|
|
||||||
documents: [
|
|
||||||
{ id: "doc7", name: "Specs_Alpha.pdf", hasCertificate: true, certificateId: "CERT-DOC-005" },
|
|
||||||
{ id: "doc8", name: "Design_Beta.figma", hasCertificate: false },
|
|
||||||
{ id: "doc9", name: "Planning.xlsx", hasCertificate: true, certificateId: "CERT-DOC-006" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "Finance",
|
|
||||||
description: "Documents financiers et budgets",
|
|
||||||
documentsCount: 32,
|
|
||||||
subfoldersCount: 4,
|
|
||||||
size: "156 MB",
|
|
||||||
created: new Date("2024-01-08T14:20:00"),
|
|
||||||
modified: new Date("2024-01-13T11:10:00"),
|
|
||||||
owner: "Marie Dubois",
|
|
||||||
access: "private",
|
|
||||||
members: ["Marie Dubois", "Admin"],
|
|
||||||
tags: ["finance", "budget", "comptabilité"],
|
|
||||||
color: "orange",
|
|
||||||
favorite: false,
|
|
||||||
storageType: "permanent",
|
|
||||||
status: "completed",
|
|
||||||
type: "finance",
|
|
||||||
expectedDocuments: [
|
|
||||||
{ name: "Budget annuel", required: true, assignedRole: "owner", status: "received" },
|
|
||||||
{ name: "Bilan comptable", required: true, assignedRole: "validator", status: "received" },
|
|
||||||
{ name: "Factures", required: true, assignedRole: "editor", status: "received" },
|
|
||||||
],
|
|
||||||
activity: [
|
|
||||||
{ user: "Marie Dubois", action: "mis à jour", item: "Budget_2024.xlsx", time: "Il y a 1j" },
|
|
||||||
{ user: "Admin", action: "vérifié", item: "Factures_Dec.pdf", time: "Il y a 2j" },
|
|
||||||
],
|
|
||||||
permissions: {
|
|
||||||
canView: true,
|
|
||||||
canEdit: true,
|
|
||||||
canDelete: true,
|
|
||||||
canInvite: true,
|
|
||||||
canArchive: false,
|
|
||||||
canAnalyze: true,
|
|
||||||
},
|
|
||||||
documents: [
|
|
||||||
{ id: "doc10", name: "Budget_2024.xlsx", hasCertificate: true, certificateId: "CERT-DOC-007" },
|
|
||||||
{ id: "doc11", name: "Factures_Dec.pdf", hasCertificate: true, certificateId: "CERT-DOC-008" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "Ressources Humaines",
|
|
||||||
description: "Politiques RH et documents employés",
|
|
||||||
documentsCount: 19,
|
|
||||||
subfoldersCount: 2,
|
|
||||||
size: "67 MB",
|
|
||||||
created: new Date("2024-01-10T08:45:00"),
|
|
||||||
modified: new Date("2024-01-12T15:30:00"),
|
|
||||||
owner: "Admin Système",
|
|
||||||
access: "shared",
|
|
||||||
members: ["Admin", "Marie Dubois", "Sophie Laurent"],
|
|
||||||
tags: ["RH", "politique", "employés"],
|
|
||||||
color: "red",
|
|
||||||
favorite: false,
|
|
||||||
storageType: "temporary",
|
|
||||||
status: "archived",
|
|
||||||
type: "hr",
|
|
||||||
expectedDocuments: [
|
|
||||||
{ name: "Politique RH", required: true, assignedRole: "owner", status: "received" },
|
|
||||||
{ name: "Contrats employés", required: true, assignedRole: "validator", status: "received" },
|
|
||||||
{ name: "Formation", required: false, assignedRole: "editor", status: "missing" },
|
|
||||||
],
|
|
||||||
activity: [
|
|
||||||
{ user: "Admin", action: "ajouté", item: "Politique_Télétravail.pdf", time: "Il y a 3j" },
|
|
||||||
{ user: "Sophie Laurent", action: "lu", item: "Guide_Onboarding.docx", time: "Il y a 4j" },
|
|
||||||
],
|
|
||||||
permissions: {
|
|
||||||
canView: true,
|
|
||||||
canEdit: true,
|
|
||||||
canDelete: true,
|
|
||||||
canInvite: true,
|
|
||||||
canArchive: true,
|
|
||||||
canAnalyze: true,
|
|
||||||
},
|
|
||||||
documents: [
|
|
||||||
{ id: "doc12", name: "Politique_Télétravail.pdf", hasCertificate: false },
|
|
||||||
{ id: "doc13", name: "Guide_Onboarding.docx", hasCertificate: true, certificateId: "CERT-DOC-009" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
name: "Marketing",
|
|
||||||
description: "Matériel marketing et campagnes",
|
|
||||||
documentsCount: 41,
|
|
||||||
subfoldersCount: 5,
|
|
||||||
size: "198 MB",
|
|
||||||
created: new Date("2023-12-20T16:00:00"),
|
|
||||||
modified: new Date("2024-01-11T13:45:00"),
|
|
||||||
owner: "Pierre Durand",
|
|
||||||
access: "shared",
|
|
||||||
members: ["Pierre Durand", "Jean Martin", "Design Team"],
|
|
||||||
tags: ["marketing", "campagne", "design"],
|
|
||||||
color: "pink",
|
|
||||||
favorite: true,
|
|
||||||
storageType: "temporary",
|
|
||||||
status: "validated",
|
|
||||||
type: "marketing",
|
|
||||||
expectedDocuments: [
|
|
||||||
{ name: "Brief campagne", required: true, assignedRole: "owner", status: "received" },
|
|
||||||
{ name: "Créations visuelles", required: true, assignedRole: "editor", status: "pending" },
|
|
||||||
{ name: "Plan média", required: true, assignedRole: "contributor", status: "missing" },
|
|
||||||
{ name: "Budget marketing", required: false, assignedRole: "validator", status: "received" },
|
|
||||||
],
|
|
||||||
activity: [
|
|
||||||
{ user: "Pierre Durand", action: "uploadé", item: "Campagne_Q1.psd", time: "Il y a 4j" },
|
|
||||||
{ user: "Design Team", action: "approuvé", item: "Logo_V2.png", time: "Il y a 5j" },
|
|
||||||
],
|
|
||||||
permissions: {
|
|
||||||
canView: true,
|
|
||||||
canEdit: false,
|
|
||||||
canDelete: false,
|
|
||||||
canInvite: true,
|
|
||||||
canArchive: true,
|
|
||||||
canAnalyze: true,
|
|
||||||
},
|
|
||||||
documents: [
|
|
||||||
{ id: "doc14", name: "Campagne_Q1.psd", hasCertificate: true, certificateId: "CERT-DOC-010" },
|
|
||||||
{ id: "doc15", name: "Logo_V2.png", hasCertificate: true, certificateId: "CERT-DOC-011" },
|
|
||||||
{ id: "doc16", name: "Brief_campagne.pdf", hasCertificate: false },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
setFolders(mockFolders)
|
setFolders(mockFolders)
|
||||||
setStats({
|
setStats({
|
||||||
@ -1250,16 +992,7 @@ export default function FoldersPage() {
|
|||||||
setActionModal({ type: null, folder: null, folders: [] })
|
setActionModal({ type: null, folder: null, folders: [] })
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeFilter = searchParams.get("type") as
|
const typeFilter = searchParams.get("type")
|
||||||
| "contracts"
|
|
||||||
| "reports"
|
|
||||||
| "projects"
|
|
||||||
| "finance"
|
|
||||||
| "hr"
|
|
||||||
| "marketing"
|
|
||||||
| "legal"
|
|
||||||
| "general"
|
|
||||||
| null
|
|
||||||
|
|
||||||
const filteredFolders = folders
|
const filteredFolders = folders
|
||||||
.filter((folder) => {
|
.filter((folder) => {
|
||||||
@ -1447,15 +1180,12 @@ export default function FoldersPage() {
|
|||||||
|
|
||||||
{menuOpen && (
|
{menuOpen && (
|
||||||
<div className="absolute mt-1 right-0 w-48 bg-white border border-gray-200 rounded shadow-lg z-50">
|
<div className="absolute mt-1 right-0 w-48 bg-white border border-gray-200 rounded shadow-lg z-50">
|
||||||
{['contrat', 'projet', 'rapport', 'finance', 'rh', 'marketing'].map((type) => (
|
<button
|
||||||
<button
|
className="w-full text-left px-4 py-2 text-gray-700 hover:bg-gray-100"
|
||||||
key={type}
|
onClick={() => handleOpenModal("general")}
|
||||||
className="w-full text-left px-4 py-2 text-gray-700 hover:bg-gray-100"
|
>
|
||||||
onClick={() => handleOpenModal(type as FolderType)}
|
Nouveau dossier
|
||||||
>
|
</button>
|
||||||
{type.charAt(0).toUpperCase() + type.slice(1)}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -2522,13 +2252,13 @@ export default function FoldersPage() {
|
|||||||
|
|
||||||
|
|
||||||
{/* Modal */}
|
{/* Modal */}
|
||||||
{folderType && (
|
{isModalOpen && (
|
||||||
<FolderModal
|
<FolderModal
|
||||||
isOpen={isModalOpen}
|
isOpen={isModalOpen}
|
||||||
onClose={handleCloseModal}
|
onClose={handleCloseModal}
|
||||||
onSave={handleSaveNewFolder}
|
onSave={handleSaveNewFolder}
|
||||||
onCancel={handleCloseModal}
|
onCancel={handleCloseModal}
|
||||||
folderType={folderType}
|
folderType={folderType || "general"}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@ -49,14 +49,7 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
|
|||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const navigation: Array<{ name: string; href: string; icon: any; type?: string }> = [
|
const navigation: Array<{ name: string; href: string; icon: any; type?: string }> = [
|
||||||
{ name: "My work", href: "/dashboard", icon: LayoutDashboard },
|
{ name: "My work", href: "/dashboard", icon: LayoutDashboard },
|
||||||
{ name: "Contrats", href: "/dashboard/folders?type=contracts", icon: Folder, type: "contracts" },
|
{ name: "Dossier", href: "/dashboard/folders", icon: Folder },
|
||||||
{ name: "Rapports", href: "/dashboard/folders?type=reports", icon: Folder, type: "reports" },
|
|
||||||
{ name: "Projets", href: "/dashboard/folders?type=projects", icon: Folder, type: "projects" },
|
|
||||||
{ name: "Finance", href: "/dashboard/folders?type=finance", icon: Folder, type: "finance" },
|
|
||||||
{ name: "RH", href: "/dashboard/folders?type=hr", icon: Folder, type: "hr" },
|
|
||||||
{ name: "Marketing", href: "/dashboard/folders?type=marketing", icon: Folder, type: "marketing" },
|
|
||||||
{ name: "Juridique", href: "/dashboard/folders?type=legal", icon: Folder, type: "legal" },
|
|
||||||
{ name: "Général", href: "/dashboard/folders?type=general", icon: Folder, type: "general" },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// Appliquer le thème global dès le chargement (préférence stockée)
|
// Appliquer le thème global dès le chargement (préférence stockée)
|
||||||
|
|||||||
@ -37,7 +37,7 @@ import EventBus from "@/lib/4nk/EventBus"
|
|||||||
import { iframeUrl } from "../page"
|
import { iframeUrl } from "../page"
|
||||||
import Iframe from "@/components/4nk/Iframe"
|
import Iframe from "@/components/4nk/Iframe"
|
||||||
|
|
||||||
type FolderType = "contrat" | "projet" | "rapport" | "finance" | "rh" | "marketing";
|
type FolderType = string;
|
||||||
|
|
||||||
export default function DashboardPage() {
|
export default function DashboardPage() {
|
||||||
const [notification, setNotification] = useState<{ type: "success" | "error" | "info"; message: string } | null>(null)
|
const [notification, setNotification] = useState<{ type: "success" | "error" | "info"; message: string } | null>(null)
|
||||||
@ -106,47 +106,27 @@ export default function DashboardPage() {
|
|||||||
modifiedAt: "Il y a 2 heures",
|
modifiedAt: "Il y a 2 heures",
|
||||||
modifiedBy: "Marie Dubois",
|
modifiedBy: "Marie Dubois",
|
||||||
status: "Signé",
|
status: "Signé",
|
||||||
folder: "Contrats 2024",
|
folder: "Général",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "doc_002",
|
id: "doc_002",
|
||||||
name: "Rapport_Financier_Q1.xlsx",
|
name: "Contrat_Fournisseur_XYZ.pdf",
|
||||||
type: "Excel",
|
type: "PDF",
|
||||||
size: "1.8 MB",
|
size: "1.8 MB",
|
||||||
modifiedAt: "Il y a 4 heures",
|
modifiedAt: "Il y a 4 heures",
|
||||||
modifiedBy: "Jean Martin",
|
modifiedBy: "Jean Martin",
|
||||||
status: "En révision",
|
status: "En révision",
|
||||||
folder: "Finance",
|
folder: "Général",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "doc_003",
|
id: "doc_003",
|
||||||
name: "Présentation_Produit_V2.pptx",
|
name: "Avenant_Contrat_123.docx",
|
||||||
type: "PowerPoint",
|
|
||||||
size: "15.2 MB",
|
|
||||||
modifiedAt: "Hier",
|
|
||||||
modifiedBy: "Sophie Laurent",
|
|
||||||
status: "Finalisé",
|
|
||||||
folder: "Marketing",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "doc_004",
|
|
||||||
name: "Cahier_des_charges_Projet_X.docx",
|
|
||||||
type: "Word",
|
type: "Word",
|
||||||
size: "892 KB",
|
size: "892 KB",
|
||||||
modifiedAt: "Il y a 2 jours",
|
modifiedAt: "Il y a 2 jours",
|
||||||
modifiedBy: "Pierre Durand",
|
modifiedBy: "Pierre Durand",
|
||||||
status: "Brouillon",
|
status: "Brouillon",
|
||||||
folder: "Projets",
|
folder: "Général",
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "doc_005",
|
|
||||||
name: "Facture_2024_001.pdf",
|
|
||||||
type: "PDF",
|
|
||||||
size: "156 KB",
|
|
||||||
modifiedAt: "Il y a 3 jours",
|
|
||||||
modifiedBy: "Marie Dubois",
|
|
||||||
status: "Payée",
|
|
||||||
folder: "Comptabilité",
|
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -166,7 +146,7 @@ export default function DashboardPage() {
|
|||||||
type: "edit",
|
type: "edit",
|
||||||
user: "Jean Martin",
|
user: "Jean Martin",
|
||||||
action: "a modifié",
|
action: "a modifié",
|
||||||
target: "Rapport_Financier_Q1.xlsx",
|
target: "Contrat_Fournisseur_XYZ.pdf",
|
||||||
time: "Il y a 4 heures",
|
time: "Il y a 4 heures",
|
||||||
icon: Edit,
|
icon: Edit,
|
||||||
color: "text-blue-600",
|
color: "text-blue-600",
|
||||||
@ -176,7 +156,7 @@ export default function DashboardPage() {
|
|||||||
type: "share",
|
type: "share",
|
||||||
user: "Sophie Laurent",
|
user: "Sophie Laurent",
|
||||||
action: "a partagé",
|
action: "a partagé",
|
||||||
target: "Présentation_Produit_V2.pptx",
|
target: "Contrat_Client_ABC_2024.pdf",
|
||||||
time: "Hier",
|
time: "Hier",
|
||||||
icon: Share2,
|
icon: Share2,
|
||||||
color: "text-purple-600",
|
color: "text-purple-600",
|
||||||
@ -186,21 +166,11 @@ export default function DashboardPage() {
|
|||||||
type: "create",
|
type: "create",
|
||||||
user: "Pierre Durand",
|
user: "Pierre Durand",
|
||||||
action: "a créé le dossier",
|
action: "a créé le dossier",
|
||||||
target: "Projets 2024",
|
target: "Dossier Général",
|
||||||
time: "Il y a 2 jours",
|
time: "Il y a 2 jours",
|
||||||
icon: Folder,
|
icon: Folder,
|
||||||
color: "text-orange-600",
|
color: "text-orange-600",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: "act_005",
|
|
||||||
type: "download",
|
|
||||||
user: "Marie Dubois",
|
|
||||||
action: "a téléchargé",
|
|
||||||
target: "Facture_2024_001.pdf",
|
|
||||||
time: "Il y a 3 jours",
|
|
||||||
icon: Download,
|
|
||||||
color: "text-indigo-600",
|
|
||||||
},
|
|
||||||
])
|
])
|
||||||
|
|
||||||
setNotifications([
|
setNotifications([
|
||||||
@ -227,10 +197,10 @@ export default function DashboardPage() {
|
|||||||
{
|
{
|
||||||
id: "notif_003",
|
id: "notif_003",
|
||||||
type: "info",
|
type: "info",
|
||||||
title: "Nouvel utilisateur",
|
title: "Nouveau contrat",
|
||||||
message: "Thomas Petit a rejoint l'équipe Marketing",
|
message: "Un nouveau document a été ajouté au dossier Général",
|
||||||
time: "Hier",
|
time: "Hier",
|
||||||
icon: Users,
|
icon: FileText,
|
||||||
color: "text-blue-600",
|
color: "text-blue-600",
|
||||||
bgColor: "bg-blue-50",
|
bgColor: "bg-blue-50",
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user