From d371b447c6f2ee529e2e9d8dfff0b18cc943ccf3 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 15 Sep 2026 23:00:45 +0200 Subject: [PATCH] Studio lot 8e : lecteur audio dans la fiche d'un point de carte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audio résolu par identifiant de ressource, portrait et nom du narrateur au-dessus du lecteur. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011VxSQeGQYUvPmSEoGdnidA --- src/components/sections/MapSection.tsx | 22 ++++++++++++++++++++-- src/lib/api/types.ts | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/sections/MapSection.tsx b/src/components/sections/MapSection.tsx index 864b254..db047fe 100644 --- a/src/components/sections/MapSection.tsx +++ b/src/components/sections/MapSection.tsx @@ -13,6 +13,8 @@ import { t, tPlain } from '@/lib/i18n' import type { SectionDTO, GeoPointDTO } from '@/lib/api/types' import { trackEvent } from '@/lib/stats' import { getGeoPointLatLng } from '@/lib/geo' +import NarratorAvatar from '@/components/ui/NarratorAvatar' +import { useAudioResource } from '@/hooks/useAudioResource' import './map/map.css' const LeafletMap = dynamic(() => import('./map/LeafletMap'), { @@ -29,6 +31,7 @@ interface Props { slug: string configId: string languages: string[] + apiKey: string } type Mode = 'map' | 'list' @@ -39,7 +42,7 @@ const DOCK_WIDTH = 340 const DETAIL_WIDTH = 320 const PANEL_TOP = 60 -export default function MapSection({ section, configId, languages }: Props) { +export default function MapSection({ section, configId, languages, apiKey }: Props) { const { language, setAvailableLanguages, instanceId } = useVisitor() const back = useBack() @@ -322,6 +325,7 @@ export default function MapSection({ section, configId, languages }: Props) { {/* Detail sheet (POI) */} {selected && ( a.language === language)?.value ?? point.audioIds?.[0]?.value, + apiKey, + ) return ( <> @@ -476,6 +485,15 @@ function PointDetail({ className="overflow-y-auto px-5 py-4 flex flex-col gap-4" style={isCard ? { flex: 1, minHeight: 0 } : { maxHeight: 'calc(80vh - 180px)' }} > + {audio.url && ( +
+ {audio.narratorName && ( + + )} +
+ )} + {t(point.description, language) && (