import { useParams } from 'react-router';
import { books } from './books';

const Details: React.FC = () => {
  const { bookId } = useParams<{ bookId: string }>();
  const book = books.find((b) => b.id === Number(bookId));

  return (
    <div>
      <h1>{book?.title}</h1>
      <p>Autor: {book?.author}</p>
      <p>ISBN: {book?.isbn}</p>
      <p>Bewertung: {book?.rating} Sterne</p>
    </div>
  );
};

export default Details;
