<?php

namespace Aura\TextBlocks\Resources;

use Eminiarts\Aura\Models\Post;

use Eminiarts\Aura\Resource;

class TextBlock extends Resource
{
    public static string $type = 'TextBlock';

    public static ?string $slug = 'textblock';

    protected static ?int $sort = 0;

    protected static ?string $group = 'Admin';


    public static function getWidgets(): array
    {
        return [];
    }

    public function getIcon()
    {
        return '<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 7H5.2C4.0799 7 3.51984 7 3.09202 7.21799C2.71569 7.40973 2.40973 7.71569 2.21799 8.09202C2 8.51984 2 9.0799 2 10.2V13.8C2 14.9201 2 15.4802 2.21799 15.908C2.40973 16.2843 2.71569 16.5903 3.09202 16.782C3.51984 17 4.07989 17 5.2 17H13M17 7H18.8C19.9201 7 20.4802 7 20.908 7.21799C21.2843 7.40973 21.5903 7.71569 21.782 8.09202C22 8.51984 22 9.0799 22 10.2V13.8C22 14.9201 22 15.4802 21.782 15.908C21.5903 16.2843 21.2843 16.5903 20.908 16.782C20.4802 17 19.9201 17 18.8 17H17M17 21L17 3M19.5 3.00001L14.5 3M19.5 21L14.5 21" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
    }

    public static function getFields()
    {
        return [
            [
                'type' => 'Eminiarts\\Aura\\Fields\\Panel',
                'name' => 'Template',
                'slug' => 'tab-template',
                'global' => true,
            ],
            // [
            //     'name' => 'Name',
            //     'type' => 'Eminiarts\\Aura\\Fields\\Text',
            //     'validation' => 'required',
            //     'on_index' => true,
            //     'on_view' => true,
            //     'on_forms' => true,
            //     'slug' => 'name',
            // ],
            [
                'name' => 'Identifier',
                'type' => 'Eminiarts\\Aura\\Fields\\Text',
                'validation' => 'required',
                'on_index' => true,
                'on_view' => true,
                'on_forms' => true,
                'slug' => 'identifier',
            ],
            // [
            //     'name' => 'Description',
            //     'type' => 'Eminiarts\\Aura\\Fields\\Textarea',
            //     'validation' => '',
            //     'on_index' => false,
            //     'on_view' => true,
            //     'on_forms' => true,
            //     'slug' => 'description',
            // ],
            [
                'name' => 'Template Body',
                'type' => 'Eminiarts\\Aura\\Fields\\Textarea',
                'validation' => 'required',
                'on_index' => false,
                'on_view' => true,
                'on_forms' => true,
                'slug' => 'template_body',
            ],
            // [
            //     'name' => 'Placeholders',
            //     'type' => 'Eminiarts\\Aura\\Fields\\Repeater',
            //     'validation' => '',
            //     'on_index' => false,
            //     'on_view' => true,
            //     'on_forms' => true,
            //     'slug' => 'placeholders',
            // ],
            // [
            //     'name' => 'Key',
            //     'type' => 'Eminiarts\\Aura\\Fields\\Text',
            //     'validation' => '',
            //     'on_index' => true,
            //     'on_view' => true,
            //     'on_forms' => true,
            //     'slug' => 'key',
            //     'style' => [
            //         'width' => '50'
            //     ]
            // ],
            // [
            //     'name' => 'Value',
            //     'type' => 'Eminiarts\\Aura\\Fields\\Text',
            //     'validation' => '',
            //     'on_index' => true,
            //     'on_view' => true,
            //     'on_forms' => true,
            //     'slug' => 'value',
            //     'style' => [
            //         'width' => '50'
            //     ]
            // ],
        ];
    }
}
