<?php
$comment_reply_type = 'new-projects-reply';
if (!empty($comment_reply_details)) {
    foreach ($comment_reply_details as $v_reply) {
        $r_profile_info = $this->db->where(array('user_id' => $v_reply->user_id))->get('tbl_account_details')->row();
        $reply_info = $this->db->where(array('task_comment_id' => $v_reply->comments_reply_id))->get('tbl_task_comment')->row();
?>
        <div id="<?php echo $comment_reply_type . "-comment-form-container-" . $v_reply->task_comment_id ?>" class="mt-3 pl-4 sm:pl-8">
            <div class="rounded-xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-800/60">
                <div class="flex items-start justify-between gap-3">
                    <div class="flex items-start gap-3">
                        <img alt="Mail Avatar" src="<?php echo base_url() . $r_profile_info->avatar ?>" class="h-9 w-9 rounded-full object-cover">
                        <div>
                            <div class="flex flex-wrap items-center gap-2">
                                <a href="#" class="text-sm font-semibold text-slate-900 dark:text-slate-100"><?= ($r_profile_info->fullname) ?></a>
                                <span class="text-xs text-slate-500 dark:text-slate-400"><?= time_ago($v_reply->comment_datetime) ?></span>
                            </div>
                            <div class="mt-1 text-sm text-slate-700 dark:text-slate-200"><?php if (!empty($v_reply->comment)) echo $v_reply->comment; ?></div>
                        </div>
                    </div>
                    <?php if ($v_reply->user_id == $this->session->userdata('user_id')) { ?>
                        <?php echo ajax_anchor(base_url("client/projects/delete_comments/$v_reply->task_comment_id"), "<i class='text-rose-600' data-lucide='trash-2'></i>", array("class" => "inline-flex items-center rounded-lg border border-rose-200 bg-rose-50 px-2 py-1 text-xs font-semibold text-rose-600 hover:bg-rose-100", "title" => lang('delete'), "data-fade-out-on-success" => "#" . $comment_reply_type . "-comment-form-container-" . $v_reply->task_comment_id)); ?>
                    <?php } ?>
                </div>
            </div>
        </div>
<?php
    }
}
?>
