<?php

declare(strict_types=1);



class ContactFormWidget extends Widget
{
     
    private static int $instance = 0;

    public function code(): string
    {
        return 'contact_form';
    }

    public function name(): string
    {
        return 'Contact form';
    }

    public function description(): string
    {
        return 'Lets visitors send you a message (DMCA, reports, general inquiries). Place it wherever you want on the page.';
    }

    public function icon(): string
    {
        return 'fa-solid fa-envelope';
    }

    public function render(array $ctx): string
    {
        return $this->partial('contact-form', [
            'flash' => $ctx['flash'] ?? null,
            'uid'   => 'cf' . (++self::$instance),
        ]);
    }
}
