import { ShieldCheck } from 'lucide-react'; import { compactLocationLabel, formatTemperature, formatWind, riskLevelLabel, weatherCodeLabel, } from '../lib/formatters'; import type { CurrentConditions, LocationOption, RiskResult, UseProfile } from '../types'; interface SemaforoCardProps { current: CurrentConditions; location: LocationOption; profile: UseProfile; risk: RiskResult; fetchedAt: string; source: 'api' | 'mock'; } export function SemaforoCard({ current, location, profile, risk, fetchedAt, source, }: SemaforoCardProps) { return (
{compactLocationLabel([location.name, location.admin1, location.country])} {source === 'mock' ? 'dados de exemplo' : `atualizado ${new Date(fetchedAt).toLocaleTimeString('pt-BR', { hour: '2-digit', minute: '2-digit' })}`}

Semáforo do Dia

{risk.title}

{riskLevelLabel(risk.level)} · risco {risk.score}/100

{risk.summary}

Agora
{formatTemperature(current.temperature)}
Sensação
{formatTemperature(current.apparentTemperature)}
Vento
{formatWind(current.windSpeed)}
Tempo
{weatherCodeLabel(current.weatherCode)}
); }