<?php

/**
 * The template for displaying a single review item
 *
 * This template can be overridden by copying it to yourtheme/movie-engine/global/review-item.php.
 *
 * @package MovieEngine
 * @version 1.0.0
 */

if (! defined("ABSPATH")) {
    exit; // Exit if accessed directly
}

$comment = $args['comment'];
$depth   = $args['depth'];
$args_cb = $args['args']; // wp_list_comments passed args
?>
<li <?php comment_class('movie-engine-review-item', $comment); ?> id="li-comment-<?php comment_ID(); ?>">
    <div id="comment-<?php comment_ID(); ?>" class="movie-engine-review-body">
        <div class="movie-engine-review-author">
            <?php echo get_avatar($comment, $args_cb['avatar_size']); ?>
        </div>
        <div class="movie-engine-review-content">
            <div class="movie-engine-review-meta">
                <div class="movie-engine-review-author-info">
                    <cite class="fn"><?php echo get_comment_author_link($comment); ?></cite>
                    <span class="movie-engine-review-date">
                        <?php printf(
                            /* translators: %1$s at %2$s */
                            esc_html__('%1$s at %2$s', 'cine-movie-engine'),
                            esc_html(get_comment_date('', $comment)),
                            esc_html(get_comment_time('', $comment))
                        );
                        ?>
                    </span>
                </div>
                <div class="reply">
                    <?php comment_reply_link(array_merge($args_cb, array(
                        'depth'     => $depth,
                        'max_depth' => $args_cb['max_depth'],
                        'reply_text' => '<span class="dashicons dashicons-undo"></span> ' . esc_html__('Reply', 'cine-movie-engine')
                    )), $comment); ?>
                </div>
            </div>
            <?php if ($comment->comment_approved == '0') : ?>
                <em class="movie-engine-awaiting-moderation"><?php esc_html_e('Your review is awaiting moderation.', 'cine-movie-engine'); ?></em>
                <br />
            <?php endif; ?>
            <div class="movie-engine-comment-text"><?php comment_text($comment); ?></div>
        </div>
    </div>
</li>