<?php

namespace GriffinForms\Includes\Integrations\HubSpot;

/**
 * HubSpot Integration (Coming Soon)
 *
 * Provides placeholder metadata so UI can surface the roadmap entry.
 *
 * @since 1.0.0
 */
class Main extends \GriffinForms\Includes\Integrations\Format
{
    protected function setMeta()
    {
        $this->meta = 'hubspot';
        $this->id = 'hubspot';
    }

    protected function buildInfo(): array
    {
        return [
            'id'          => 'hubspot',
            'name'        => 'HubSpot',
            'category'    => 'Marketing',
            'description' => __('Push new leads into HubSpot CRM, lists, and workflows. 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' => __('HubSpot integration is not available yet.', 'griffinforms-form-builder'),
        ];
    }

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

    public function getLibraryInstructions(): string
    {
        return __('HubSpot support is shipping soon. No manual setup required yet.', 'griffinforms-form-builder');
    }

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

    public function getConfigurationFormHtml(): string
    {
        $message = '<div class="alert alert-info">' .
            esc_html__('HubSpot CRM sync is coming soon. Check back after launch to connect your portal.', 'griffinforms-form-builder') .
            '</div>';

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