<?php

class MBFaqComponent extends MBComponentBase {
    protected function init_options($options) {
        $options->enabled = true;
        $options->id = "inoby-faq-component";
        $options->title = __("FAQ", "inoby");
        $options->icon = "align-wide";
        $options->render_template = get_theme_file_path("components/faq/template.php");
        $options->fields = [
            [
                "type" => "custom_html",
                "std" =>
                  '<h3>Často kladené otázky</h3><p>Zadajte otázky a napíšte k ním odpovede.</p>',
              ],
            [
            "group_title" => __("Otázka #{#} {question}", "inoby"),
            "id" => "faq_component",
            "type" => "group",
            "clone" => true,
            "sort_clone" => true,
            "collapsible" => true,
            "default_state" => "collapsed",
            "add_button" => __("Pridať otázku", "inoby"),
            "fields" => [
                [
                    "name" => __("Otázka", "inoby"),
                    "id" => "question",
                    "type" => "text",
                ],
                [
                    "name" => __("Odpoveď", "inoby"),
                    "id" => "answer",
                    "type" => "wysiwyg",
                    "sanitize_callback" => "none",
                ],
            ],
            ],
        ];
    }
}