{% extends "base.html" %}
{% block title %}Delete {{ battery.label }} — Battery Tracker{% endblock %}

{% block content %}
<h1>Delete Battery</h1>

<div class="card">
  <p style="margin-bottom:1rem;">
    You are about to <strong>permanently delete</strong> battery
    <strong>{{ battery.label }}</strong> ({{ battery.brand }}).
    This action cannot be undone.
  </p>

  {% if battery.is_installed() %}
    <p class="text-warning" style="margin-bottom:1rem;">
      ⚠ This battery is currently installed in
      <strong>{{ battery.device.name }}</strong>.
      Deleting it will free that slot.
    </p>
  {% endif %}

  <div class="form-actions">
    <form method="post" action="{{ url_for('battery_delete', battery_id=battery.id) }}">
      <button class="btn btn-danger" type="submit">Confirm Delete</button>
    </form>
    <a class="btn btn-secondary" href="{{ url_for('battery_detail', battery_id=battery.id) }}">Cancel</a>
  </div>
</div>
{% endblock %}
