import { Link } from 'react-router';
import { type Book } from './Book';

type Props = {
  books: Book[];
};

const List: React.FC<Props> = ({ books }) => {
  return (
    <>
      {books.map((book) => (
        <div key={book.id}>
          {book.title}
          <Link to={`/details/${book.id}`}>Details</Link>
        </div>
      ))}
    </>
  );
};

export default List;
