<?php
/**
 * Output of the single tournament matches.
 *
 * @package cyberpress/templates
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

$tournament     = cyberpress()->get_the_tournament();
$matches        = new CyberPress_Matches_List_block();
$matches_output = $matches->block_render(
    array(
        'columns'                    => 1,
        'count'                      => -1,
        'filterByTournaments'        => (string) $tournament->get_id(),
        'displayPagination'          => false,
        'displayMetaGame'            => true,
        'displayMetaTournament'      => false,
        'displayMetaTournamentStage' => true,
        'displayMetaReadMoreButton'  => false,
        'displayTeamPlayers'         => false,
        'blockRendered'              => false,
        'displayTeamLogo'            => true,
        'displayTeamName'            => true,
        'displayMatchTitle'          => false,
        'displayMatchStartDate'      => true,
        'displayMatchPoints'         => true,
        'displayMetaMatchStartDate'  => false,
        'displayMetaMatchEndDate'    => false,
    )
);

if ( $matches_output ) {
    echo '<h3>' . esc_html__( 'Matches', 'cyberpress' ) . '</h3>';

    // phpcs:ignore
    echo $matches_output;
}
