import { Text, View } from 'react-native'; import type { Network, Particle } from '@/api/types'; import { resolveHumanDisplay } from '@/lib/humans'; import { RelativeTimestamp } from '@/components/RelativeTimestamp'; import { Avatar } from '@/components/Avatar'; import { useStreamPresence } from './stream-presence-context'; interface StreamMetadataHeaderProps { particle: Particle | null; network: Network | null; } /** * Avatar + display name + relative time. Sits below the segmented bar so the * "who/when" answer is always one glance away — Snapchat-style. */ export function StreamMetadataHeader({ particle, network, }: StreamMetadataHeaderProps) { const { onlineHumanIds } = useStreamPresence(); if (!particle) return null; const display = resolveHumanDisplay( particle.created_by_human_id, network?.humans, ); const editedAt = particle.type === 'text' ? particle.properties.edited_at : undefined; const isOnline = particle.created_by_human_id ? onlineHumanIds.has(particle.created_by_human_id) : false; return ( {display.displayName} {editedAt ? ( · edited{' '} ) : null} ); }