import type { MetroEntry } from "@/types/analytics"; interface Props { nearest_name: string | null; nearest_walk_minutes: number | null; top3: MetroEntry[] | null; } export function ObjectMetroList({ nearest_name, nearest_walk_minutes, top3, }: Props) { // Build display list: prefer top3 array, fallback to nearest fields const entries: MetroEntry[] = top3 && top3.length > 0 ? top3 : nearest_name ? [ { name: nearest_name, time: nearest_walk_minutes, line: null, color: null, isWalk: true, }, ] : []; if (entries.length === 0) { return (

Данные о метро отсутствуют.

); } return (
{entries.map((m, i) => (
{m.name}
{m.line ? (
{m.line}
) : null}
{m.time != null ? (
{m.isWalk !== false ? "🚶" : "🚗"} {m.time} мин
) : null}
))}
); }