<?php

namespace App\Domain\Website\Blocks\Types;

use App\Domain\Website\Blocks\BlockField;
use App\Domain\Website\Blocks\BlockType;
use App\Domain\Website\Enums\BlockCategory;

/**
 * Escape hatch for anything the block catalogue does not cover yet.
 * Rendered sanitised — see BlockRenderer — so a pasted snippet cannot inject
 * script into a tenant's public site.
 */
class CustomHtmlBlock extends BlockType
{
    public function key(): string
    {
        return 'custom_html';
    }

    public function label(): string
    {
        return 'كود مخصص';
    }

    public function icon(): string
    {
        return 'code-bracket';
    }

    public function category(): BlockCategory
    {
        return BlockCategory::Advanced;
    }

    public function fields(): array
    {
        return [
            BlockField::code('html', 'HTML'),
            BlockField::toggle('full_width', 'عرض كامل'),
        ];
    }
}
