<?php
namespace Storzen\Fields;
use Storzen\Contracts\Field;
defined('ABSPATH') || exit;

class Notice extends Field {
    /** @var string */ protected $html = '';
    /** @var string */ protected $type = 'info';

    /** @return static */ public function set_html( $h ) { $this->html = $h; return $this; }
    /** @return static */ public function html( $h )     { return $this->set_html($h); }
    /** @return static */ public function set_type( $t ) { $this->type = $t; return $this; }
    /** @return static */ public function type( $t )     { return $this->set_type($t); }

    public function sanitize( $raw ) { return null; }
    public function get_default()    { return null; }

    public function render( $value ) {
        echo '<div class="sz-notice sz-notice--' . esc_attr($this->type) . '">';
        echo wp_kses_post( $this->html );
        echo '</div>';
    }
}
