<?php
/**
 * File: app/Admin/config/tools.php
 *
 * @package KimaAI
 * @since 1.1.0
 */

return [
  'order' => 10,
  'schema' => [
    'type' => 'object',
    'title' => __('Tools', 'kimaai'),
    'icon' => 'tool',
    'isOpen' => false,
    'properties' => [
      'exportSettings' => [
        'type' => null,
        'title' => __('Export Settings', 'kimaai'),
        'link' => 'export-settings',
        'pageTitle' => __('Export & Import Settings', 'kimaai'),
        'pageDescription' => __('Export KimaAI settings as JSON for backups or moving settings to another site.', 'kimaai'),
        'component' => 'SettingsImportExport',
        'showSaveButton' => false,
      ],
      'logSettings' => [
        'type' => 'object',
        'title' => __('Log Settings', 'kimaai'),
        'link' => 'log-settings',
        'pageTitle' => __('Log Settings', 'kimaai'),
        'pageDescription' => __('Configure the logging settings for KimaAI. You can enable or disable logging and set log levels.', 'kimaai'),
        'sections' => [
          'general' => [
            'title' => __('General Log Settings', 'kimaai'),
            'description' => __('Configure general logging settings for KimaAI.', 'kimaai'),
          ],
        ],
        'properties' => [
          'logLevel' => [
            'section' => 'general',
            'type' => 'string',
            'component' => 'RadioField',
            'default' => 'info',
            'props' => [
              'label' => __('Log Level', 'kimaai'),
              'description' => __('Select the minimum log level to record. Logs with a level equal to or higher than the selected level will be recorded. 
              For example, if you select "Warning", only "Warning" and "Error" logs will be recorded, while "Notice", "Info", and "Debug" logs will be ignored.', 'kimaai'),
              'options' => [
                [
                  'value' => 'error',
                  'label' => __('Error (50)', 'kimaai'),
                ],
                [
                  'value' => 'warn',
                  'label' => __('Warning (40)', 'kimaai'),
                ],
                [
                  'value' => 'notice',
                  'label' => __('Notice (30)', 'kimaai'),
                ],
                [
                  'value' => 'info',
                  'label' => __('Info (20)', 'kimaai'),
                ],
                [
                  'value' => 'debug',
                  'label' => __('Debug (10)', 'kimaai'),
                ],
              ],
            ],
          ],
        ],
      ],
      'logs' => [
        'type' => null,
        'title' => __('Logs', 'kimaai'),
        'link' => 'logs',
        'pageTitle' => __('Logs', 'kimaai'),
        'pageDescription' => __('Here you can find the plugin logs', 'kimaai'),
        'component' => 'ShowLogFile',
        'showSaveButton' => false,
      ],
      'about' => [
        'type' => null,
        'title' => __('About Us', 'kimaai'),
        'link' => 'about',
        'pageTitle' => __('About Us', 'kimaai'),
        'pageDescription' => __('Here you can find information about the plugin', 'kimaai'),
        'component' => 'About',
        'showSaveButton' => false,
      ],
    ],
  ],
];
