imeshuek commited on
Commit
03ff8d7
·
verified ·
1 Parent(s): 09a448a

Upload admin-dashboard/page.tsx

Browse files
Files changed (1) hide show
  1. admin-dashboard/page.tsx +132 -0
admin-dashboard/page.tsx ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client'
2
+ import { useState } from 'react'
3
+
4
+ const systemMetrics = [
5
+ { label:'Active Users', value:'2,847', change:'+12%', good:true },
6
+ { label:'Vendors Listed', value:'486', change:'+8', good:true },
7
+ { label:'Active Contracts', value:'1,203', change:'23 disputed', good:false },
8
+ { label:'Platform Revenue', value:'₨ 4.2M', change:'+15%', good:true },
9
+ ]
10
+
11
+ const moderationQueue = [
12
+ { id:'1', vendor:'Golden Moments Cinema', type:'New Vendor', issue:'Pending KYC verification', date:'2 hours ago', priority:'high' },
13
+ { id:'2', vendor:'Bliss Decorators', type:'Content Flag', issue:'3 images flagged for IP review', date:'5 hours ago', priority:'medium' },
14
+ { id:'3', vendor:'Mountain View Resort', type:'Review Flag', issue:'8 reviews reported as suspicious', date:'1 day ago', priority:'low' },
15
+ { id:'4', vendor:'Starlit DJ Events', type:'Template Review', issue:'Contract template submitted for approval', date:'2 days ago', priority:'medium' },
16
+ ]
17
+
18
+ export default function AdminDashboard() {
19
+ const [tab, setTab] = useState('overview')
20
+
21
+ return (
22
+ <div className="min-h-screen bg-ivory-50">
23
+ <div className="wedding-section py-8">
24
+ <div className="flex items-center justify-between mb-8">
25
+ <div>
26
+ <h1 className="font-heading text-3xl font-semibold text-charcoal-700">Admin Portal</h1>
27
+ <p className="text-charcoal-400 mt-1">Platform oversight & governance</p>
28
+ </div>
29
+ <div className="flex items-center gap-3">
30
+ <span className="wedding-badge bg-sage-50 text-sage-600">System Healthy</span>
31
+ <button className="wedding-btn-outline text-sm">Export Report</button>
32
+ </div>
33
+ </div>
34
+
35
+ <div className="flex gap-1 bg-ivory-100 rounded-xl p-1 mb-6">
36
+ {['overview','moderation','contracts','users','schema'].map(t=>(
37
+ <button key={t} onClick={()=>setTab(t)}
38
+ className={"px-4 py-2 rounded-lg text-sm font-medium capitalize transition-colors "+(tab===t?'bg-white text-charcoal-700 shadow-soft':'text-charcoal-400 hover:text-charcoal-600')}>{t}</button>
39
+ ))}
40
+ </div>
41
+
42
+ {/* Metrics */}
43
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
44
+ {systemMetrics.map(m=>(
45
+ <div key={m.label} className="wedding-card p-5">
46
+ <p className="text-xs text-charcoal-400 mb-1">{m.label}</p>
47
+ <p className="font-heading text-2xl font-semibold text-charcoal-700">{m.value}</p>
48
+ <p className={"text-xs mt-1 "+(m.good?'text-sage-500':'text-rose-500')}>{m.change}</p>
49
+ </div>
50
+ ))}
51
+ </div>
52
+
53
+ {/* Moderation Queue */}
54
+ <div className="wedding-card mb-8">
55
+ <div className="p-5 border-b border-ivory-200 flex items-center justify-between">
56
+ <h2 className="font-heading text-lg font-semibold text-charcoal-700">Moderation Queue</h2>
57
+ <span className="wedding-badge bg-rose-50 text-rose-500">{moderationQueue.length} pending</span>
58
+ </div>
59
+ <div className="divide-y divide-ivory-100">
60
+ {moderationQueue.map(item=>(
61
+ <div key={item.id} className="p-5 flex items-center justify-between hover:bg-ivory-50 transition-colors">
62
+ <div>
63
+ <div className="flex items-center gap-2 mb-1">
64
+ <p className="text-sm font-medium text-charcoal-700">{item.vendor}</p>
65
+ <span className="text-xs text-charcoal-400">{item.type}</span>
66
+ <span className={"wedding-badge text-xs "+(item.priority==='high'?'bg-rose-50 text-rose-500':item.priority==='medium'?'bg-gold-50 text-gold-600':'bg-ivory-100 text-charcoal-400')}>
67
+ {item.priority.toUpperCase()}
68
+ </span>
69
+ </div>
70
+ <p className="text-xs text-charcoal-400">{item.issue} · {item.date}</p>
71
+ </div>
72
+ <div className="flex gap-2">
73
+ <button className="wedding-btn-gold text-xs px-3 py-1.5">Review</button>
74
+ <button className="text-xs px-3 py-1.5 border border-charcoal-200 rounded-lg text-charcoal-400 hover:text-charcoal-600 transition-colors">Dismiss</button>
75
+ </div>
76
+ </div>
77
+ ))}
78
+ </div>
79
+ </div>
80
+
81
+ {/* Contract Governance */}
82
+ <div className="wedding-card">
83
+ <div className="p-5 border-b border-ivory-200 flex items-center justify-between">
84
+ <h2 className="font-heading text-lg font-semibold text-charcoal-700">Contract Governance</h2>
85
+ <div className="flex gap-2">
86
+ <button className="wedding-btn-outline text-xs">Export Audit (CSV)</button>
87
+ <button className="wedding-btn-outline text-xs">Export Audit (PDF)</button>
88
+ </div>
89
+ </div>
90
+ <div className="overflow-x-auto">
91
+ <table className="w-full">
92
+ <thead>
93
+ <tr className="bg-ivory-50">
94
+ <th className="text-left p-4 font-heading text-xs font-semibold text-charcoal-500 uppercase tracking-wider">Contract</th>
95
+ <th className="text-left p-4 font-heading text-xs font-semibold text-charcoal-500 uppercase tracking-wider">Vendor</th>
96
+ <th className="text-left p-4 font-heading text-xs font-semibold text-charcoal-500 uppercase tracking-wider">Client</th>
97
+ <th className="text-left p-4 font-heading text-xs font-semibold text-charcoal-500 uppercase tracking-wider">Status</th>
98
+ <th className="text-left p-4 font-heading text-xs font-semibold text-charcoal-500 uppercase tracking-wider">Actions</th>
99
+ </tr>
100
+ </thead>
101
+ <tbody className="divide-y divide-ivory-100">
102
+ {[
103
+ { id:'CTR-001', vendor:'Lens & Light Studio', client:'Amaya & Ruwan', status:'signed' },
104
+ { id:'CTR-005', vendor:'The Grand Atrium', client:'Nisha & Kaveen', status:'disputed' },
105
+ { id:'CTR-012', vendor:'Bloom & Petal', client:'Thilini & Ashan', status:'amended' },
106
+ ].map(row=>(
107
+ <tr key={row.id} className="hover:bg-ivory-50 transition-colors">
108
+ <td className="p-4 text-sm font-medium text-charcoal-700">{row.id}</td>
109
+ <td className="p-4 text-sm text-charcoal-600">{row.vendor}</td>
110
+ <td className="p-4 text-sm text-charcoal-600">{row.client}</td>
111
+ <td className="p-4">
112
+ <span className={"wedding-badge text-xs "+(row.status==='signed'?'bg-sage-50 text-sage-600':row.status==='disputed'?'bg-rose-50 text-rose-500':'bg-gold-50 text-gold-600')}>
113
+ {row.status.charAt(0).toUpperCase()+row.status.slice(1)}
114
+ </span>
115
+ </td>
116
+ <td className="p-4">
117
+ <div className="flex gap-2">
118
+ <button className="text-xs text-gold-500 hover:text-gold-600">View Audit</button>
119
+ {row.status==='disputed'&&<button className="text-xs text-rose-500 hover:text-rose-600">Mediate</button>}
120
+ <button className="text-xs text-charcoal-400 hover:text-charcoal-600">Export</button>
121
+ </div>
122
+ </td>
123
+ </tr>
124
+ ))}
125
+ </tbody>
126
+ </table>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ )
132
+ }