{{!
  Copyright IBM Corp. 2016, 2025
  SPDX-License-Identifier: BUSL-1.1
}}

<Hds::ApplicationState class="has-top-margin-xxl" ...attributes as |A|>
  <A.Header
    @title={{or @title (if (eq @error.httpStatus 403) "You are not authorized" "Error")}}
    data-test-empty-state-title
  />

  <A.Body data-test-empty-state-message>
    {{#if (eq @error.httpStatus 403)}}
      <p>
        You must be granted permissions to view this page. Ask your administrator if you think you should have access to the
        <code>{{@error.path}}</code>
        endpoint.
      </p>
    {{else}}
      <ul>
        {{#if @error.message}}
          <li>{{@error.message}}</li>
          <hr />
        {{/if}}
        {{#each @error.errors as |error|}}
          <li>
            {{error}}
          </li>
        {{/each}}
      </ul>
    {{/if}}
  </A.Body>

  <A.Footer data-test-empty-state-actions>
    {{#if (has-block "actions")}}
      {{yield to="actions"}}
    {{/if}}
  </A.Footer>
</Hds::ApplicationState>