-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathTableView.js
More file actions
31 lines (27 loc) · 1.12 KB
/
TableView.js
File metadata and controls
31 lines (27 loc) · 1.12 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
import React from 'react';
import ResourcesList from '../data/data.json';
import { Link } from "react-router-dom";
import styles from './TableView.module.css';
import Toggle from "../Toggle";
const TableView = props => {
return (
<div className="container">
<Toggle />
<table className={styles['resource-table']}>
<th className= {styles['resource-table-head']}>ID</th>
<th className= {styles['resource-table-head']}>Name</th>
<th className= {styles['resource-table-head']}>URL</th>
{
ResourcesList.map(resource =>
<tr className = {styles['resource-table-row']} key={resource.id}>
<td className = {styles['resource-table-data']}>{resource.id}</td>
<td className = {styles['resource-table-data']}>{resource.name}</td>
<td className = {styles['resource-table-data']}>{<Link className="resourceLink" to={`/resources/${resource.id}`}><span>More info</span></Link>}</td>
</tr>
)
}
</table>
</div>
);
}
export default TableView;