import { useEffect } from "react"; import { Text, View } from "react-native"; import { Trash2 } from "lucide-react-native"; import type { Particle } from "@/api/types"; import { useNetwork } from "@/hooks/use-networks"; import { resolveHumanDisplay } from "@/lib/humans"; // How long to linger on a tombstone before auto-advancing. Same cadence as // desktop — a beat long enough to read "this was deleted," not so long it // stalls the stream. const TOMBSTONE_DURATION_MS = 2000; interface DeletedParticleViewProps { particle: Particle; networkId: string; paused: boolean; onEnded: () => void; } export function DeletedParticleView({ particle, networkId, paused, onEnded, }: DeletedParticleViewProps) { const network = useNetwork(networkId); const deleterId = "deleted_by_human_id" in particle ? particle.deleted_by_human_id : undefined; const deleter = deleterId ? resolveHumanDisplay(deleterId, network?.humans) : null; useEffect(() => { if (paused) return; const timeout = setTimeout(onEnded, TOMBSTONE_DURATION_MS); return () => clearTimeout(timeout); }, [paused, onEnded, particle.id]); return ( This particle was deleted {deleter ? ( by {deleter.displayName} ) : null} ); }