import { books } from '@/books';
import { NextPage } from 'next/dist/types';

type Props = {
  params: Promise<{ id: string }>;
};

const BookDetailsPage: NextPage<Props> = async ({ params }) => {
  const { id } = await params;
  const book = books.find((b) => b.id === parseInt(id));

  return (
    <div>
      <h1>{book?.title}</h1>
      <p>Author: {book?.author}</p>
    </div>
  );
};

export default BookDetailsPage;
