<div class="d-flex mb-4">
<?php 
    if ( $reply['clientId'] || !file_exists(PATH_ASSETS.'/images/avatar/'.$reply['name'].'.jpg') ) :
        $parts    = explode(' ', $reply['name']);
        $initials = substr($parts[0], 0, 1) . substr(end($parts), 0, 1);
?>
        <div class="initial-avatar flex-shrink-0 me-2" alt="<?php echo $reply['name']; ?>" title="<?php echo $reply['name']; ?>"><?php echo $initials; ?></div>
<?php 
    else : 
?>
        <img src="<?php echo URL_ASSETS; ?>/images/avatar/<?php echo $reply['name']; ?>.jpg" class="avatar-small me-2" alt="<?php echo $reply['name']; ?>" title="<?php echo $reply['name']; ?>">
<?php 
    endif; 
?>
    <div id="btb-reply-<?php echo $reply['id']; ?>" class="d-block w-100">
        <div class="card">
            <div class="card-body p-2">
                <div class="d-flex justify-content-between">
                    <p class="fw-bold"><?php echo $reply['name']; ?></p>
                    <small class="text-muted"><?php echo time_elapsed_string($reply['createdAt']); ?></small>
                </div>
                    <div class="d-flex justify-content-between align-items-center">
                        <p class="mb-0">
                            <?php echo nl2br(htmlspecialchars($reply['text'])); ?>
                        </p>
                    </div>
            </div>
        </div>
        <div class="d-flex p-1">
            <button id="btb-post-like-btn-<?php echo $reply['id']; ?>" class="btn p-0 btbLike btbAction" data-comment-id="<?php echo $reply['id']; ?>" data-action="click" data-target="like/dislike comment id <?php echo $reply['id']; ?>">
                <span id="btb-post-like-icon-<?php echo $reply['id']; ?>" class="btbLikeIcon">
<?php
                        if ( is_array($userLikes) ) :
                            if ( in_array($reply['id'], $userLikes) ) : 
?>
                                <i class="bi bi-hand-thumbs-up-fill text-danger"></i>
<?php 
                            else : 
?>
                                <i class="bi bi-hand-thumbs-up"></i>
<?php
                            endif;
                        endif; 
?>
                </span>
                <span class="text-muted ms-1">Like</span>
            </button>
            <span class="mx-1">&#183;</span>
            <a id="btb-post-like-count-<?php echo $reply['id']; ?>" role="button" <?php if ( $reply['likeString'] ) : ?>data-bs-toggle="tooltip" data-bs-html="true" data-bs-title="<?php echo $reply['likeString']; ?>" <?php endif; ?> class="text-danger"><?php echo $replyLikeText; ?></a>
            <!-- <span class="mx-2">&#183;</span> -->
            <!-- <span class="text-muted"><?php // echo time_elapsed_string($reply['createdAt']); ?></span> -->
        </div>
    </div>
</div>