<?= $this->extend('layouts/mobile') ?>

<?= $this->section('header') ?>
<?= view('layouts/_inner_header', [
    'title'    => ($query ?? '') !== '' ? (string) $query : 'Search',
    'backHref' => isset($dash, $filters) ? $dash->href('dashboard', $filters) : site_url('dashboard'),
]) ?>
<?= view('dashboard/_filter_bar', ['showBell' => false]) ?>
<?= $this->endSection() ?>

<?= $this->section('content') ?>
<?php if (! empty($filterError)): ?>
    <div class="flash flash-error" role="alert"><?= esc($filterError) ?></div>
<?php endif; ?>
<?php $emptyMessage = $emptyMessage ?? 'Enter something to search.'; ?>
<div class="priority-list" data-task-lists data-status-filter="<?= esc($filters['status'] ?? 'pending') ?>" data-empty-message="<?= esc($emptyMessage) ?>">
    <?php $rows = $rows ?? []; ?>
    <?php if ($rows === []): ?>
        <p class="quadrant-empty"><?= esc($emptyMessage) ?></p>
    <?php else: ?>
        <?php foreach ($rows as $row): ?>
            <?= view('dashboard/_task_row', ['row' => $row, 'showPriority' => true]) ?>
        <?php endforeach; ?>
    <?php endif; ?>
</div>
<?= view('dashboard/_task_sheets') ?>
<?= $this->endSection() ?>
