File size: 2,179 Bytes
2e8db96 9751a50 18d5404 2e8db96 9751a50 5874113 2e8db96 18d5404 9751a50 18d5404 2e8db96 d81fbeb 2e8db96 |
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 |
import logo from './logo.svg';
import './App.css';
import axios from "axios";
import { useState } from 'react';
import { useEffect } from 'react';
import {
Table,
TableHeader,
TableBody,
TableColumn,
TableRow,
TableCell
} from "@nextui-org/table";
function App() {
const [statements, setStatements] = useState([
"Empty statements"
]);
// function to fetch all statements from BE
useEffect(() => {
axios
.get("/data")
.then((response) => {
console.log("Got data ", response.data);
setStatements(JSON.stringify(response.data));
})
.catch((error) => {
console.log("There was an error retrieving the statement list: ", error);
setStatements(JSON.stringify(error));
});
}, []);
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Experiments
<Table
aria-label="Experiments"
>
<TableHeader>
<TableColumn>ID</TableColumn>
<TableColumn>Link</TableColumn>
</TableHeader>
<TableBody>
<TableRow key="hf">
<TableCell><pre><code>Hugging Face</code></pre></TableCell>
<TableCell><a href="https://huggingface.co/introspector">Hugging Face</a></TableCell>
</TableRow>
<TableRow key="gh">
<TableCell>
<pre><code>Github Repositories</code></pre></TableCell>
<TableCell><a href="https://github.com/meta-introspector">Github</a></TableCell>
</TableRow>
<TableRow key="bp">
<TableCell>
<pre><code>Blog posts</code></pre></TableCell>
<TableCell><a href="https://h4ck3rm1k3.wordpress.com">Wordpress</a></TableCell>
</TableRow>
<TableRow key="tweets">
<TableCell>
<pre><code>Tweets</code></pre></TableCell>
<TableCell><a href="https://x.com/introsp3ctor">Twitter</a></TableCell>
</TableRow>
<TableRow key="statements">
<TableCell>
<pre><code>RDF Statements of knowledge from api</code></pre></TableCell>
<TableCell> {statements} </TableCell>
</TableRow>
</TableBody>
</Table>
</p>
</header>
</div>
);
}
export default App;
|