<?php

namespace GriffinForms\Includes\Integrations\MicrosoftTeams;

/**
 * Microsoft Teams Integration (Coming Soon)
 */
class Main extends \GriffinForms\Includes\Integrations\Format
{
    protected function setMeta()
    {
        $this->meta = 'microsoft_teams';
        $this->id = 'microsoft_teams';
    }

    protected function buildInfo(): array
    {
        return [
            'id'          => 'microsoft_teams',
            'name'        => 'Microsoft Teams',
            'category'    => 'Notifications',
            'description' => __('Post submission notifications to Microsoft Teams channels. Launching soon.', 'griffinforms-form-builder'),
            'scope'       => [
                'is_global'      => true,
                'allow_override' => true,
            ],
            'coming_soon' => true,
        ];
    }

    public function getStatus(): array
    {
        return [
            'configured'  => false,
            'active'      => false,
            'message'     => __('Coming soon', 'griffinforms-form-builder'),
            'coming_soon' => true,
        ];
    }

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

    protected function saveConfiguration(array $config): bool
    {
        return false;
    }

    protected function validateConnection(): array
    {
        return [
            'success' => false,
            'message' => __('Microsoft Teams integration is not available yet.', 'griffinforms-form-builder'),
        ];
    }

    public function isLibraryInstalled(): bool
    {
        return true;
    }

    public function getLibraryInstructions(): string
    {
        return __('Configuration unlocks after launch.', 'griffinforms-form-builder');
    }

    public function isConfigured(): bool
    {
        return false;
    }

    public function getConfigurationFormHtml(): string
    {
        $message = '<div class="gf-notice gf-notice-info">' .
            esc_html__('Microsoft Teams settings will be available soon.', 'griffinforms-form-builder') .
            '</div>';

        return $this->renderConfigurationFormTemplate(
            'griffinforms-microsoft-teams-config',
            $this->id,
            $message
        );
    }
}
