library/pages/index.tsx

21 lines
357 B
TypeScript
Raw Normal View History

2021-11-16 22:38:00 -05:00
import React from "react";
2021-10-30 19:44:32 -04:00
import { getAllBooks, SimpleBook } from "../lib/books";
export default function Home(props: Props) {
console.log(props.books);
2021-11-13 20:41:05 -05:00
return <main>I am a book</main>;
}
interface Props {
books: SimpleBook[];
}
2021-10-30 19:44:32 -04:00
export async function getServerSideProps() {
return {
props: {
books: await getAllBooks(),
},
};
}