Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created March 3, 2019 18:48
Show Gist options
  • Save agoiabel/f630bbdd1f95434389550ebf515f51a5 to your computer and use it in GitHub Desktop.
Save agoiabel/f630bbdd1f95434389550ebf515f51a5 to your computer and use it in GitHub Desktop.
let users;
if (this.state.users !== null) {
users = this.state.users.map(user => (
<tr key={user.id}>
<td>{user.id}</td>
<td>{user.first_name}</td>
<td>{user.last_name}</td>
</tr>
));
}
return (
<div className={styles.app}>
<table className={styles.table}>
<thead>
<tr>
<th>S/N</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
{ users }
</tbody>
</table>
<div className={styles.pagination}>
<span>&laquo;</span>
<span className={styles.active}>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>&raquo;</span>
</div>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment