<%- include('includes/header', {username: admin[0].name, email: admin[0].email }) %>

    <div class="body-wrapper">
        <div class="container-fluid">
            <div class="card bg-info-subtle shadow-none position-relative overflow-hidden mb-4">
                <div class="card-body px-4 py-3">
                    <div class="row align-items-center">
                        <div class="col-md-8 col-sm-7">
                            <h4 class="fw-semibold mb-1">Manage Stats</h4>
                        </div>

                        <div class="col-md-4 col-sm-5 text-md-end text-sm-start mt-3 mt-md-0">
                            <button id="addherostatBtn" class="btn btn-primary px-4">
                                <i class="fa-solid fa-plus me-2"></i> Add Stat
                            </button>
                        </div>
                    </div>
                </div>
            </div>
   <div class="datatables">
    <div class="card">
        <div class="card-body">
            <div class="table-responsive">
                <table id="herostat_config"
                    class="table table-striped table-bordered text-nowrap align-middle">
                    <thead>
                        <tr>
                            <th>Label</th>
                            <th>Icon</th>
                            <th>Count</th>
                            <th class="action-col">Action</th>
                        </tr>
                    </thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
    </div>

    <!-- MODAL -->
    <div class="modal fade" id="herostatModal" tabindex="-1">
        <div class="modal-dialog modal-md modal-dialog-centered">
            <div class="modal-content border-0 shadow-lg rounded-3">
                <div class="modal-header bg-light-subtle">
                    <h5 class="modal-title fw-semibold" id="herostatModalLabel">
                        Add Stat
                    </h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>

                <div class="modal-body p-4">
                    <form id="herostatForm">
                        <input type="hidden" id="herostatId">

                        <div class="mb-3">
                            <label class="form-label fw-medium">Label <span class="text-danger">*</span></label>
                            <input type="text" id="herostatLabel" class="form-control" required>
                        </div>

                        <div class="mb-3">
                            <label class="form-label fw-medium">Icon Name <span class="text-danger">*</span></label>
                            <input type="text" id="iconName" class="form-control"
                                    required>
                                                       <small class="text-muted d-block mt-1">
                      <strong>Note:</strong> Please copy the <strong>Component Name</strong> of
                      the icon
                      from
                      <a href="https://lucide.dev/icons" target="_blank">
                        https://lucide.dev/icons
                      </a>
                    </small>
                        </div>

                        <div class="mb-3">
                            <label class="form-label fw-medium">Count <span class="text-danger">*</span></label>
                            <input type="text" id="herostatCount" class="form-control" required>
                        </div>

                        <div class="modal-footer border-0 pt-0">
                            <button type="button" class="btn btn-light" data-bs-dismiss="modal">
                                Cancel
                            </button>
                            <button type="submit" class="btn btn-primary px-4">
                                Save
                            </button>
                        </div>
                    </form>
                </div>

            </div>
        </div>
    </div>
</div>

        </div>
    </div>

    <%- include('includes/allscripts') %>
        <script src="/js/view/herostat.js"></script>
