<?php
declare(strict_types=1);
// ==================================================
// Nuclear Fancy Pants Edition™ — NUCLEAR+++
// File: /includes/class-instagram-channel.php
// Description: Instagram social channel — implements ChannelInterface, connects via Facebook OAuth - NUCLEAR+++
// Last Edited: 2026-04-09
// ==================================================

namespace AutoMarketerAI;

defined('ABSPATH') || exit;

final class InstagramChannel implements ChannelInterface
{
    public function get_slug(): string
    {
        return 'instagram';
    }

    public function get_label(): string
    {
        return 'Instagram';
    }

    public function get_color(): string
    {
        return '#E1306C';
    }

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

    public function get_connection_status(): string
    {
        return FacebookAuth::getInstagramAccountId() !== null ? 'connected' : 'disconnected';
    }

    public function handle_actions(): void
    {
        // Instagram has no separate OAuth flow — connection is via Facebook.
        // No actions to handle here.
    }

    public function render(): void
    {
        if (FacebookAuth::getInstagramAccountId() === null) {
            include AMAI_PLUGIN_DIR . 'templates/social/instagram-connect.php';
            return;
        }

        include AMAI_PLUGIN_DIR . 'templates/social/instagram-dashboard.php';
    }
}