<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2026, Jiri Eischmann <jiri@eischmann.cz> and the meshy contributors -->
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="libadwaita" version="1.0"/>
  <template class="MeshySensorView" parent="GtkBox">
    <property name="orientation">vertical</property>

    <!-- Placeholder shown when no sensor is selected -->
    <child>
      <object class="AdwStatusPage" id="placeholder">
        <property name="icon-name">weather-clear-symbolic</property>
        <property name="title" translatable="yes">Select a Sensor</property>
        <property name="vexpand">true</property>
      </object>
    </child>

    <!-- Main content (hidden until a sensor is set) -->
    <child>
      <object class="GtkScrolledWindow" id="scroll">
        <property name="visible">false</property>
        <property name="vexpand">true</property>
        <child>
          <object class="GtkBox" id="content_box">
            <property name="orientation">vertical</property>
            <property name="spacing">12</property>
            <property name="margin-start">12</property>
            <property name="margin-end">12</property>
            <property name="margin-top">12</property>
            <property name="margin-bottom">12</property>

            <!-- Status row for loading/error messages -->
            <child>
              <object class="AdwPreferencesGroup" id="status_group">
                <child>
                  <object class="AdwActionRow" id="status_row">
                    <property name="title" translatable="yes">Status</property>
                    <property name="subtitle">--</property>
                  </object>
                </child>
              </object>
            </child>

            <!-- Map frame for GPS data (hidden until GPS telemetry arrives) -->
            <child>
              <object class="GtkFrame" id="map_frame">
                <property name="visible">false</property>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>

    <!-- Bottom action bar -->
    <child>
      <object class="GtkCenterBox" id="action_bar">
        <property name="visible">false</property>
        <property name="margin-start">12</property>
        <property name="margin-end">12</property>
        <property name="margin-top">8</property>
        <property name="margin-bottom">12</property>
        <child type="center">
          <object class="GtkBox">
            <property name="spacing">8</property>
            <property name="halign">center</property>
            <child>
              <object class="GtkSpinner" id="spinner">
                <property name="visible">false</property>
              </object>
            </child>
            <child>
              <object class="GtkButton" id="refresh_btn">
                <property name="icon-name">view-refresh-symbolic</property>
                <property name="tooltip-text" translatable="yes">Refresh Telemetry</property>
                <style>
                  <class name="pill"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkButton" id="login_btn">
                <property name="icon-name">system-lock-screen-symbolic</property>
                <property name="tooltip-text" translatable="yes">Login for Admin Access</property>
                <property name="visible">false</property>
                <style>
                  <class name="pill"/>
                </style>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>

  </template>
</interface>
