import { Paper, Text, Stack, Group, Badge, ScrollArea } from '@mantine/core'
import { IconMapPin, IconVolume } from '@tabler/icons-react'
import { ActionIcon } from '@mantine/core'
import type { GuideResponse } from '../lib/api'
interface GuidePanelProps {
response: GuideResponse | null
loading: boolean
onSpeak: (text: string) => void
speaking: boolean
onStopSpeaking: () => void
}
export function GuidePanel({ response, loading, onSpeak, speaking, onStopSpeaking }: GuidePanelProps) {
if (loading) {
return (
Consultando tu entorno...
)
}
if (!response) {
return (
Pulsa el micrófono o el botón de explorar para recibir información sobre tu entorno.
)
}
const { guide, location, pois } = response
return (
{/* Location header */}
{location.street ? `${location.street}, ` : ''}
{location.neighbourhood ? `${location.neighbourhood}, ` : ''}
{location.city}
{/* Guide text */}
Guía
speaking ? onStopSpeaking() : onSpeak(guide)}
>
{guide}
{/* POIs */}
{pois.length > 0 && (
Lugares cercanos
{pois.map(poi => (
{poi.name}
{poi.category}
{(poi.score ?? 0) > 0 && (
{poi.score?.toFixed(1)}
)}
))}
)}
)
}