const books = new Array(1000_000)
  .fill({
    title: 'Design Patterns',
    author: 'Erich Gamma',
    isbn: '978-0201633610',
    rating: 5,
  })
  .map((book, id) => ({ ...book, id }));

const List: React.FC = () => {
  return (
    <table>
      <thead>
        <tr>
          <th>Titel</th>
          <th>Autor</th>
          <th>ISBN</th>
          <th>Bewertung</th>
        </tr>
      </thead>
      <tbody>
        {books.map((book) => (
          <tr key={book.id}>
            <td>{book.title}</td>
            <td>{book.author}</td>
            <td>{book.isbn}</td>
            <td>{book.rating && <span>{'*'.repeat(book.rating)}</span>}</td>
          </tr>
        ))}
      </tbody>
    </table>
  );
};

export default List;
