Skip to content

Commit 7b81840

Browse files
committed
add a simple component for displaying a user
1 parent 5b6d47e commit 7b81840

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

app/javascript/components/user.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { UserDetail } from '../generated_types/users'
2+
3+
type Props = {
4+
user: UserDetail
5+
}
6+
7+
const User = ({ user }: Props) => {
8+
return (
9+
<>
10+
<h2>{user.name}</h2>
11+
<table>
12+
<tbody>
13+
<tr>
14+
<th>Id</th>
15+
<td>{user.id}</td>
16+
</tr>
17+
<tr>
18+
<th>email</th>
19+
<td>{user.email}</td>
20+
</tr>
21+
<tr>
22+
<th>Date of birth</th>
23+
<td>{user.date_of_birth}</td>
24+
</tr>
25+
</tbody>
26+
</table>
27+
</>
28+
)
29+
}
30+
31+
export default User

0 commit comments

Comments
 (0)