<.table id="packets" rows={@packets}>
<:col :let={packet} label="Sender">
<.link
navigate={~p"/packets/#{packet.base_callsign}"}
class="text-blue-600 hover:text-blue-800 font-medium"
>
{packet.sender}
<:col :let={packet} label="SSID">
{packet.ssid}
<:col :let={packet} label="Base Callsign">
<.link
navigate={~p"/packets/#{packet.base_callsign}"}
class="text-blue-600 hover:text-blue-800 font-medium"
>
{packet.base_callsign}
<:col :let={packet} label="Data Type">
{packet.data_type}
<:col :let={packet} label="Symbol">
<% data = Map.get(packet, :data_extended) || %{}
raw_table = Map.get(data, :symbol_table_id) || Map.get(data, "symbol_table_id") || "/"
table = if raw_table in ["/", "\\", "]"], do: raw_table, else: "/"
code = Map.get(data, :symbol_code) || Map.get(data, "symbol_code") || ">" %>
{table}{code}
<:col :let={packet} label="Destination">
{packet.destination}
<:col :let={packet} label="Information">
{packet.information_field}
<:col :let={packet} label="Path">
{packet.path}
<%= if length(@packets) == 0 do %>
No packets
Packets will appear here as they are received.
<% end %>