<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }

class KNSDD_WC_Notice_Presenter {
    /**
     * WooCommerce native notification sistemiyle checkout uyarılarını gösterir.
     * Mesajlar boş ise hiçbir şey yapmaz. Gösterim yapıldıysa true döner.
     */
    public function present_checkout_notices( $messages, $message_renderer ) {
        if ( empty( $messages ) ) { return false; }
        if ( $message_renderer ) {
            $message_renderer->render_wc_notices( $messages );
        }
        return true;
    }

    /**
     * Fallback 1: Custom checkout notices kutusu ile göster.
     */
    public function present_checkout_notices_fallback1( $messages, $message_renderer ) {
        if ( empty( $messages ) ) { return false; }
        if ( $message_renderer ) {
            $message_renderer->render_custom_checkout_notices( $messages );
        }
        return true;
    }

    /**
     * Fallback 2: Inline checkout notices olarak göster.
     */
    public function present_checkout_notices_fallback2( $messages, $message_renderer ) {
        if ( empty( $messages ) ) { return false; }
        if ( $message_renderer ) {
            $message_renderer->render_inline_checkout_notices( $messages );
        }
        return true;
    }

    /**
     * Fallback 3: Minimal tablo satırı olarak göster.
     */
    public function present_checkout_notices_table_fallback( $messages, $message_renderer ) {
        if ( empty( $messages ) ) { return false; }
        if ( $message_renderer ) {
            $message_renderer->render_clean_table_notices( $messages );
        }
        return true;
    }
}
