-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathPageOneContent.js
More file actions
96 lines (93 loc) · 1.99 KB
/
PageOneContent.js
File metadata and controls
96 lines (93 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* eslint-disable react/prop-types */
import { useState } from 'react';
import { Box, DataTable, Avatar, Text } from 'grommet';
const data = [
{
id: 1,
initials: 'AL',
name: 'Alex Lee',
email: 'alex.lee@example.com',
status: 'Active',
},
{
id: 2,
initials: 'SM',
name: 'Sofia Martinez',
email: 'sofia.martinez@example.com',
status: 'Active',
},
{
id: 3,
initials: 'JR',
name: 'Jordan Roberts',
email: 'jordan.roberts@example.com',
status: 'Pending',
},
{
id: 4,
initials: 'AK',
name: 'Aisha Khan',
email: 'aisha.khan@example.com',
status: 'Inactive',
},
{
id: 5,
initials: 'DL',
name: 'Daniel Lopez',
email: 'daniel.lopez@example.com',
status: 'Active',
},
{
id: 6,
initials: 'NP',
name: 'Nina Patel',
email: 'nina.patel@example.com',
status: 'Active',
},
{
id: 7,
initials: 'MT',
name: 'Marco Tan',
email: 'marco.tan@example.com',
status: 'Pending',
},
];
export const PageOneContent = () => {
const [selected, setSelected] = useState([]);
return (
<Box>
<DataTable
data={data}
aria-describedby="User management table"
select={selected}
onSelect={setSelected}
columns={[
{
property: 'name',
header: 'User name',
primary: true,
render: datum => (
<Box direction="row" gap="small" align="center">
<Avatar background="decorative-green">
<Text color="text-strong">
{datum.initials}
</Text>
</Avatar>
<Text>{datum.name}</Text>
</Box>
),
},
{
property: 'email',
header: 'Email',
},
{
property: 'status',
header: 'Status',
render: datum => <Text>{datum.status}</Text>,
},
]}
/>
</Box>
);
};