import AuthorDetails from '@/books/AuthorDetails';
import BookDetails from '@/books/BookDetails';
import { NextPage } from 'next';
import { Suspense } from 'react';

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

const BookDetailsPage: NextPage<Props> = async ({ params }) => {
  const { id } = await params;
  return (
    <div>
      <h1>Details</h1>
      <hr />
      <Suspense fallback={<p>Lade Buchdetails...</p>}>
        <BookDetails bookId={id} />
      </Suspense>
      <hr />
      <Suspense fallback={<p>Lade Autoreninformationen...</p>}>
        <AuthorDetails bookId={id} />
      </Suspense>
    </div>
  );
};

export default BookDetailsPage;
