<.header>

Packets for {@callsign}

Showing up to 100 packets (stored and live) for callsign {@callsign}

<.link navigate={~p"/"} class="text-sm text-blue-600 hover:text-blue-800"> ← Back to Map <.link navigate={~p"/packets"} class="text-sm text-blue-600 hover:text-blue-800"> All Packets
<%= if @error do %>

Error

{@error}
<% else %>
<.table id="callsign-packets" rows={@all_packets}> <:col :let={packet} label="Time"> <%= case packet.received_at do %> <% %DateTime{} = dt -> %> {Calendar.strftime(dt, "%H:%M:%S")} <% dt when is_binary(dt) -> %> <%= case DateTime.from_iso8601(dt) do %> <% {:ok, parsed_dt, _} -> %> {Calendar.strftime(parsed_dt, "%H:%M:%S")} <% _ -> %> {dt} <% end %> <% _ -> %> N/A <% end %> <:col :let={packet} label="Sender"> {packet.sender} <:col :let={packet} label="Data Type"> {packet.data_type} <:col :let={packet} label="Information"> <%= if String.length(packet.information_field || "") > 50 do %> {String.slice(packet.information_field, 0, 50)}... <% else %> {packet.information_field} <% end %> <:col :let={packet} label="Path"> {packet.path}
<%= if length(@all_packets) == 0 do %>

No packets found for {@callsign}

Packets will appear here as they are received live or if there are stored packets for this callsign.

<% end %>
Live packets: {length(@live_packets)} Stored packets: {length(@packets)} Total: {length(@all_packets)}/100
<% end %>