{% extends "partials/base.html" %}
{% block title %}Failed files{% endblock %}
{% block content %}
    <div class="card text-center mt-1 shadow-sm">
        <div class="card-header">
            <ul class="nav nav-tabs card-header-tabs">
                <li class="nav-item">
                    <a class="nav-link active" aria-current="true" href="#">Files</a>
                </li>
            </ul>
        </div>
        <div class="card-body">
            <h5 class="card-title d-flex justify-content-between align-items-center">
                Unmatched Files
                <button id="refreshFiles" type="button" class="btn btn-secondary ms-1">Refresh</button>
            </h5>
            <div class="card-text">
                <div id="filesResult">
                    {% include 'render/failedFiles.html' %}
                </div>
            </div>
        </div>
    </div>
    <div id="searchForm" class="modal fade shadow-sm" tabindex="-1" aria-labelledby="searchFormLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="searchFormLabel">Search</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <label for="queryInput" class="form-label">Search query</label>
                    <input type="text" class="form-control" id="queryInput" value="{{ file }}">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary search" data-bs-target="#searchResults" data-bs-toggle="modal" data-bs-dismiss="modal">
                        Submit
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div id="searchResults" class="modal fade shadow-sm" tabindex="-1" aria-labelledby="modalSearchResultsLabel" aria-hidden="true">
        <div class="modal-dialog modal-xl">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="modalSearchResultsLabel">Search Result</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <div class="progress"></div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
