<?php

namespace GriffinForms\Includes\Integrations\Zapier;

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

    protected function buildInfo(): array
    {
        return [
            'id'          => 'zapier',
            'name'        => 'Zapier',
            'category'    => 'Automation',
            'description' => __('Trigger zaps and connect to thousands of apps. Launching soon.', 'griffinforms-form-builder'),
            'scope'       => [
                'is_global'      => true,
                'allow_override' => false,
            ],
            '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' => __('Zapier 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__('Zapier connection settings will appear here once available.', 'griffinforms-form-builder') .
            '</div>';

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