<?php
defined( 'ABSPATH' ) || exit;

/**
 * Booking actions partial.
 *
 * Expected variables:
 * - Optional: $manage_booking_url (string)
 * - Optional: $dashboard_url (string)
 * - Optional: $add_to_calendar_url (string)
 */
$bookaro_manage_url = '';
if ( isset( $manage_booking_url ) && is_string( $manage_booking_url ) ) {
    $bookaro_manage_url = $manage_booking_url;
} elseif ( isset( $dashboard_url ) && is_string( $dashboard_url ) ) {
    $bookaro_manage_url = $dashboard_url;
}
$bookaro_calendar_url = '';
if ( isset( $add_to_calendar_url ) && is_string( $add_to_calendar_url ) ) {
    $bookaro_calendar_url = $add_to_calendar_url;
}

if ( '' === $bookaro_manage_url && '' === $bookaro_calendar_url ) {
    return;
}
?>
<h3 class="bookaro-email-subheading"><?php esc_html_e( 'Next steps', 'mybookaro' ); ?></h3>
<p style="text-align:center;">
    <?php if ( '' !== $bookaro_manage_url ) : ?>
        <a href="<?php echo esc_url( $bookaro_manage_url ); ?>" class="btn">
            <?php esc_html_e( 'Manage booking', 'mybookaro' ); ?>
        </a>
    <?php endif; ?>
    <?php if ( '' !== $bookaro_calendar_url ) : ?>
        <a href="<?php echo esc_url( $bookaro_calendar_url ); ?>" class="btn btn--secondary" style="margin-left:8px;">
            <?php esc_html_e( 'Add to calendar', 'mybookaro' ); ?>
        </a>
    <?php endif; ?>
</p>
