Skip to content

Commit 28ee0d6

Browse files
committed
hotfix: Updated Login test component
1 parent 2b1b695 commit 28ee0d6

3 files changed

Lines changed: 66 additions & 128 deletions

File tree

src/shared/composites/ListCard/ListCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function ListCard({
5252
handleToggle()
5353
}
5454
}}
55+
onClick={handleToggle}
5556
>
5657
<div className="p-4">{header}</div>
5758

src/views/LoginPage.tsx

Lines changed: 65 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,76 @@
1-
// import LoginCard from '@/LoginCard'
2-
import MetricCard from '@/shared/composites/MetricCard'
1+
import { useState } from 'react'
32

4-
// import { ChipGroup } from '@/Chip'
3+
import { ChipGroup } from '@/Chip'
54

6-
// import ReportCard from '@/shared/composites/ReportCard'
5+
import ReportCard from '@/shared/composites/ReportCard'
76

8-
// import { reports } from '@/shared/composites/ReportCard/dummyData'
7+
import { reports } from '@/shared/composites/ReportCard/dummyData'
98

109
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)
4113

4214
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+
))}
5773
</div>
58-
{/* <LoginCard /> */}
5974
</div>
6075
)
6176
}

src/views/LoginPage1.tsx

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)