La in dapper, och routing. fixade upp lite exempelsidor
This commit is contained in:
22
Frontend/src/components/AuthorList.tsx
Normal file
22
Frontend/src/components/AuthorList.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { createSignal, onMount, For, type Component } from "solid-js";
|
||||
import AuthorCard from "./AuthorCard";
|
||||
import BibblanService from "../services/bibblanservice";
|
||||
import { author } from "../types/types";
|
||||
|
||||
const BookList: Component = () => {
|
||||
const [authors, setAuthors] = createSignal<author[]>([]);
|
||||
onMount(() => {
|
||||
BibblanService.getAuthors().then(setAuthors);
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Books!</h1>
|
||||
<div class="book-grid d-flex flex-wrap justify-content-between gap-3 p-3">
|
||||
<For each={authors()}>{(item) => <AuthorCard author={item} />}</For>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default BookList;
|
Reference in New Issue
Block a user