fix: add pharmacy map to ProductView and fix pharmacies endpoint

- Added PharmacyMap component to ProductView
- Updated backend to accept all valid sources for pharmacies endpoint
- Shows map with pharmacy locations and list of pharmacies with prices
This commit is contained in:
Antoni Nuñez Romeu
2026-07-16 16:48:25 +02:00
parent 08b7437803
commit 6155fdcd15
2 changed files with 7 additions and 1 deletions
+4
View File
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react';
import PharmacyMap from '../components/PharmacyMap';
import './ProductView.css';
export default function ProductView({ source, id, onBack }) {
@@ -150,6 +151,9 @@ export default function ProductView({ source, id, onBack }) {
<h3 className="pharmacies-title">
Disponible en {pharmacies.length} {pharmacies.length === 1 ? 'farmacia' : 'farmacias'}
</h3>
<PharmacyMap pharmacies={pharmacies} />
<div className="pharmacies-grid">
{pharmacies.map((pharmacy) => (
<div key={pharmacy.id} className="product-pharmacy-card">