Archived
1
0
This repository has been archived on 2023-05-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
home-page/src/components/Bookmarks.js
2021-12-27 13:43:02 -06:00

33 lines
731 B
JavaScript

import { useEffect, useState } from 'react';
import LinkGroups from './LinkGroups';
function Links() {
const [state, setState] = useState([]);
const getData = async () => {
const response = await fetch("/sui/api/links");
const data = await response.json();
setState(data);
};
useEffect(() => {
getData();
}, []);
return (
<section id="links">
<h3>Bookmarks</h3>
<div id="links_loop">
{state.map((bookmarkList) => (
<LinkGroups
key={bookmarkList.category}
category={bookmarkList.category}
links={bookmarkList.links}
/>
))}
</div>
</section>
);
}
export default Links;