You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
import React from "react";
|
|
import { useEffect, useState } from "react";
|
|
import { Link } from "react-router-dom";
|
|
import "./Index.css";
|
|
|
|
const App = () => {
|
|
const [connections, setConnections] = useState([])
|
|
useEffect(() => {
|
|
fetch('/api/connections').then(x => x.json()).then(x => setConnections(x) )
|
|
}, [])
|
|
return (
|
|
<div>
|
|
<table className="c-table">
|
|
<thead>
|
|
<tr>
|
|
<th>AGB</th>
|
|
<th>Naam</th>
|
|
<th>Geactiveerde diensten</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{connections.map(x => {
|
|
return (<tr key={x.ID}>
|
|
<td>{x.OrganisationId}</td>
|
|
<td>{x.OrganisationDisplayName}</td>
|
|
<td>{x.Services.length ? x.Services.map((s) => {
|
|
return <span key={s.Service.ID} style={{marginRight: 10}}><Link to={`/connecties/${x.ID}/${s.ID}`} >{s.Service.Name}</Link></span>
|
|
}) : '-'}</td>
|
|
</tr>)
|
|
})}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default App; |