<div class="d-flex align-items-center overflow-x-scroll bg-secondary-subtle border-bottom shadow-sm p-2 mb-2">
    <span class="text-nowrap fw-bold me-5"><?php echo $userProject['title']; ?> Project</span>
    <div class="hstack gap-2 ms-auto">
        <?php if ( $user['admin'] ) : ?>
            <button class="btn btn-sm btn-danger btbAction" type="button" data-action="click" data-target="create" data-bs-toggle="modal" data-bs-target="#createModal" title="Create">
                <i class="bi bi-plus"></i>
            </button>
        <?php endif; ?>
        <?php if ( $allowed ) : ?>
            <?php if ( $view == 'c' ) : ?>
                <a class="btn btn-sm btn-danger" type="button" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=s" title="Social">
                    <i class="bi bi-chat-square-text"></i>
                </a>
            <?php else : ?>
                <a class="btn btn-sm btn-danger" type="button" href="<?php echo URL_APP; ?>/project/?projectId=<?php echo $pid; ?>&view=c" title="Calendar">
                    <i class="bi bi-calendar3"></i>
                </a>
            <?php endif; ?>
        <?php endif; ?>
        <?php // if ( count($images) ) : ?>
            <!-- <button class="btn btn-sm btn-danger btbAction" type="button" data-action="click" data-target="files drawer" data-bs-toggle="offcanvas" data-bs-target="#imageDrawer" title="Files">
                <i class="bi bi-folder"></i>
            </button> -->
        <?php // endif; ?>
        <?php if ( count($plans) > 0 ) : ?>
            <button class="btn btn-sm btn-danger btbAction" type="button" data-action="click" data-target="plans drawer" data-bs-toggle="offcanvas" data-bs-target="#plansDrawer" title="Plans">
                <i class="bi bi-p-square"></i>
            </button>
        <?php endif; ?>
        <?php if ( count($models) > 0 ) : ?>
            <button class="btn btn-sm btn-danger btbAction" type="button" data-action="click" data-target="models drawer" data-bs-toggle="offcanvas" data-bs-target="#modelsDrawer" title="3D Models">
                <i class="bi bi-badge-3d"></i>
            </button>
        <?php endif; ?>
        <?php if ( $user['superAdmin'] || $user['admin'] ) : ?>
            <a href="<?php echo URL_APP; ?>/selections/?projectId=<?php echo $pid; ?>" class="btn btn-sm btn-danger btbAction" type="button" data-action="click" data-target="selections button" title="Selections">
                <i class="bi bi-card-list"></i>
            </a>
        <?php endif; ?>
        <button type="button" class="btn btn-sm btn-danger btbAction" data-action="click" data-target="contact button" data-bs-toggle="modal" data-bs-target="#contactModal" title="Contact">
            <i class="bi bi-envelope-arrow-up"></i>
        </button>
        <?php if ( $user['admin'] ) : ?>
            <form method="GET">
                <select id="projectSelect" class="form-select form-select-sm" name="projectId" onchange="if(this.value != 'Load project'){this.form.submit()}" style="width:auto;">
                    <option>Load project</option>
                    <?php foreach ( $projects as $project ) : ?>
                        <option value="<?php echo $project['id']; ?>" ><?php echo $project['title']; ?></option>
                    <?php endforeach; ?>
                </select>
            </form>
        <?php endif; ?>
    </div>
</div>