import { html } from 'lit';
import { classMap } from 'lit/directives/class-map.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import ProjectNavigationElement from './ProjectNavigation.js';
import { Kind as ProjectRequestKind } from '@api-client/core/models/ProjectRequest.js';
import '../../md/icons/ui-icon.js';
export default class ProjectRunnerNavigationElement extends ProjectNavigationElement {
    _renderParentChildrenTemplate(parent) {
        const { key } = parent;
        const folders = parent.listFolders();
        const requests = parent.listRequests();
        const isProject = parent.getProject() === undefined;
        return html `
      ${folders.map((f) => this.renderFolder(f, isProject ? undefined : key))}
      ${requests.map((r) => this.renderRequest(r, isProject ? undefined : key))}
    `;
    }
    renderRequest(request, parentKey) {
        const { key } = request;
        const name = request.info.name || 'Unnamed request';
        const classes = {
            'request-item': true,
            'project-tree-item': true,
        };
        return html `
      <li
        class="${classMap(classes)}"
        role="treeitem"
        aria-selected="false"
        tabindex="0"
        data-parent="${ifDefined(parentKey)}"
        data-key="${key}"
        data-kind="${ProjectRequestKind}"
        draggable="true"
        aria-disabled="true"
      >
        <div class="list-item-content">
          <ui-icon icon="request" class="object-icon"></ui-icon>
          <span class="item-label">${name}</span>
        </div>
      </li>
    `;
    }
}
//# sourceMappingURL=ProjectRunnerNavigationElement.js.map