import { Link } from 'react-router-dom';

import products from '../data/products';

function Products() {
  return (
    <main>
      <h1>Produkty</h1>
      <ul id="products-list">
        {products.map((product) => (
          <li key={product.id}>
            <Link to={`/products/${product.id}`}>
              {product.title} ({product.price} zł)
            </Link>
          </li>
        ))}
      </ul>
    </main>
  );
}

export default Products;
