|
1 | | -// import LoginCard from '@/LoginCard' |
2 | | -import MetricCard from '@/shared/composites/MetricCard' |
| 1 | +import { useState } from 'react' |
3 | 2 |
|
4 | | -// import { ChipGroup } from '@/Chip' |
| 3 | +import { ChipGroup } from '@/Chip' |
5 | 4 |
|
6 | | -// import ReportCard from '@/shared/composites/ReportCard' |
| 5 | +import ReportCard from '@/shared/composites/ReportCard' |
7 | 6 |
|
8 | | -// import { reports } from '@/shared/composites/ReportCard/dummyData' |
| 7 | +import { reports } from '@/shared/composites/ReportCard/dummyData' |
9 | 8 |
|
10 | 9 | const LoginPage = () => { |
11 | | - const metricCardData = [ |
12 | | - { |
13 | | - idx: 1, |
14 | | - label: 'Pending', |
15 | | - value: 3, |
16 | | - subLabel: 'awaiting action', |
17 | | - valueColor: 'warning', |
18 | | - }, |
19 | | - { |
20 | | - idx: 2, |
21 | | - label: 'Escalated', |
22 | | - value: 1, |
23 | | - subLabel: 'needs review', |
24 | | - valueColor: 'danger', |
25 | | - }, |
26 | | - { |
27 | | - idx: 3, |
28 | | - label: 'AI Auto-resolved', |
29 | | - value: 8, |
30 | | - subLabel: 'this week', |
31 | | - valueColor: 'success', |
32 | | - }, |
33 | | - { |
34 | | - idx: 4, |
35 | | - label: 'Escalation Rate', |
36 | | - value: '34%', |
37 | | - subLabel: 'of all reports', |
38 | | - valueColor: 'default', |
39 | | - }, |
40 | | - ] as const |
| 10 | + const [selected, setSelected] = useState('all') |
| 11 | + |
| 12 | + const [expandedId, setExpandedId] = useState<string | null>(null) |
41 | 13 |
|
42 | 14 | return ( |
43 | | - <div className="flex min-h-screen flex-col gap-6 sm:p-6"> |
44 | | - {' '} |
45 | | - <div className="grid grid-cols-2 gap-3 lg:grid-cols-4"> |
46 | | - {metricCardData.map((item) => { |
47 | | - return ( |
48 | | - <MetricCard |
49 | | - key={item.idx} |
50 | | - label={item.label} |
51 | | - value={item.value} |
52 | | - subLabel={item.subLabel} |
53 | | - valueColor={item.valueColor} |
54 | | - /> |
55 | | - ) |
56 | | - })} |
| 15 | + <div className="min-h-screen space-y-6"> |
| 16 | + {/* Header */} |
| 17 | + |
| 18 | + <div className="flex flex-wrap items-center justify-between gap-4"> |
| 19 | + <div className="text-text-primary text-lg font-semibold">Active Reports</div> |
| 20 | + |
| 21 | + <ChipGroup |
| 22 | + selected={selected} |
| 23 | + onChange={(value) => { |
| 24 | + setSelected(value) |
| 25 | + |
| 26 | + console.log('Selected:', value) |
| 27 | + }} |
| 28 | + options={[ |
| 29 | + { |
| 30 | + label: 'All', |
| 31 | + value: 'all', |
| 32 | + }, |
| 33 | + |
| 34 | + { |
| 35 | + label: 'Escalated', |
| 36 | + value: 'escalated', |
| 37 | + count: 1, |
| 38 | + }, |
| 39 | + |
| 40 | + { |
| 41 | + label: 'Spam', |
| 42 | + value: 'spam', |
| 43 | + }, |
| 44 | + |
| 45 | + { |
| 46 | + label: 'Hate speech', |
| 47 | + value: 'hate-speech', |
| 48 | + }, |
| 49 | + |
| 50 | + { |
| 51 | + label: 'Misinformation', |
| 52 | + value: 'misinformation', |
| 53 | + }, |
| 54 | + ]} |
| 55 | + /> |
| 56 | + </div> |
| 57 | + |
| 58 | + {/* Report cards */} |
| 59 | + <div className="space-y-4"> |
| 60 | + {reports.map((report) => ( |
| 61 | + <ReportCard |
| 62 | + key={report.id} |
| 63 | + report={report} |
| 64 | + isExpanded={expandedId === report.id} |
| 65 | + onToggleExpand={() => { |
| 66 | + setExpandedId(expandedId === report.id ? null : report.id) |
| 67 | + }} |
| 68 | + onAction={(reportId, action) => { |
| 69 | + console.log('Action:', action, 'on', reportId) |
| 70 | + }} |
| 71 | + /> |
| 72 | + ))} |
57 | 73 | </div> |
58 | | - {/* <LoginCard /> */} |
59 | 74 | </div> |
60 | 75 | ) |
61 | 76 | } |
|
0 commit comments