'use client'; import type { Participant } from '@/types'; interface FriendMarkerProps { participant: Participant; isCurrentUser?: boolean; onClick?: () => void; } export default function FriendMarker({ participant, isCurrentUser = false, onClick, }: FriendMarkerProps) { const { emoji, color, name, status, location } = participant; // Calculate how stale the location is const getLocationAge = () => { if (!location) return null; const ageMs = Date.now() - location.timestamp.getTime(); const ageSec = Math.floor(ageMs / 1000); if (ageSec < 60) return `${ageSec}s ago`; const ageMin = Math.floor(ageSec / 60); if (ageMin < 60) return `${ageMin}m ago`; return 'stale'; }; const locationAge = getLocationAge(); const isStale = locationAge === 'stale'; return (