library/pages/index.tsx

20 lines
323 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
2022-02-15 22:24:26 -05:00
import { getBook, DetailedBook } from "../lib/books";
2021-10-30 19:44:32 -04:00
2022-02-15 22:24:26 -05:00
export default function Home(props: Props) {
return <p>{props.book.title}</p>;
}
interface Props {
book: DetailedBook;
}
export async function getServerSideProps() {
return {
props: {
book: await getBook(2),
},
};
}