<?php
// components/Form/Notification.php
namespace Components\Form;

class Notification extends BaseField {
    /**
     * Render a notification block within a form.
     * 
     * Options:
     * - id: (string) unique ID for persistence. If provided, dismissal state is tracked.
     * - dismissible: (bool) show a close button. Default true.
     * - variant: 'brand' | 'warning' | 'danger'
     * - message: (string) the message to display. If omitted, the label is used.
     */
    public static function render(string $name, string $label, $value = '', array $opts = []): string {
        $message = $opts['message'] ?? $label;
        $id = $opts['id'] ?? $name;
        $dismissible = isset($opts['dismissible']) ? (bool)$opts['dismissible'] : true;
        $variant = $opts['variant'] ?? 'brand';
        $class = $opts['class'] ?? '-mb-6';
        $minimizedClass = $opts['minimizedClass'] ?? 'absolute right-10 mt-0 z-50';

        return \Components\Notification::render($message, [
            'id' => $id,
            'dismissible' => $dismissible,
            'variant' => $variant,
            'class' => $class,
            'minimizedClass' => $minimizedClass,
        ]);
    }
}
