import { Book } from '@/books/Book';
import data from '@/data/books.json';
import { NextPage } from 'next';
import Link from 'next/link';

const BooksPage: NextPage = () => {
  return (
    <div>
      <h1>Books</h1>
      <ul>
        {(data.books as Book[]).map((b) => (
          <li key={b.id}>
            <Link href={`/books/${b.id}`}>{b.title}</Link>
          </li>
        ))}
      </ul>
    </div>
  );
};

export default BooksPage;
