{% macro mhclgTestBanner(label, return_to_deliver=true) %}
  <div class="app-test-data-banner govuk-body govuk-!-margin-bottom-0">
    <div class="govuk-width-container">
      <div class="app-test-data-banner--container">
        <div class="app-test-data-banner__tag">
          <strong>{{ label }}</strong>
        </div>
        {% if return_to_deliver %}
          <div>
            <a class="govuk-button govuk-button--inverse app-test-data-banner__inverse govuk-!-margin-bottom-0" href="{{ url_for('deliver_grant_funding.list_grants') }}">Return to Deliver grant funding</a>
          </div>
        {% endif %}
      </div>
    </div>
  </div>
{% endmacro %}

{% macro mhclgStopPreviewingBanner(runner) %}
  <div class="app-test-data-banner govuk-body govuk-!-margin-bottom-0">
    <div class="govuk-width-container">
      <div class="app-test-data-banner--container">
        <div class="app-test-data-banner__tag">
          <strong>Form preview</strong>
        </div>
        <div>
          <a
            class="govuk-button govuk-button--inverse app-test-data-banner__inverse govuk-button--secondary govuk-!-margin-bottom-0"
            href="{{ url_for('deliver_grant_funding.return_from_test_submission', collection_id=runner.submission.collection.id) }}">
            Return to form builder
          </a>
        </div>
      </div>
    </div>
  </div>
{% endmacro %}

{% macro mhclgInlinePageTestDataBanner(label) %}
  <div class="app-test-data-banner--standalone govuk-body govuk-!-margin-bottom-0">
    <div class="app-test-data-banner__tag">
      <strong>{{ label }}</strong>
    </div>
  </div>
{% endmacro %}

{% macro mhclgRequestTracingBanner() %}
  {% if request_tracing_state %}
    {% set label = "Request tracing enabled for " ~ request_tracing_state.expires_in ~ ": " ~ (request_tracing_state.levels | join(", ")) %}
    <div class="app-request-tracing-banner govuk-body govuk-!-margin-bottom-0">
      <div class="govuk-width-container">
        <div class="app-request-tracing-banner--container">
          <div class="app-request-tracing-banner__tag">
            <strong>{{ label }}</strong>
          </div>
          <div>
            <form method="post" action="{{ url_for('developer_tools.stop') }}" class="govuk-!-margin-bottom-0">
              <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
              <button type="submit" class="app-request-tracing-banner__link-button">Stop tracing</button>
            </form>
          </div>
        </div>
      </div>
    </div>
  {% endif %}
{% endmacro %}
