<?php
defined('ABSPATH') || exit;

// generate a random string for the nonce
$nonce = md5(wp_rand(100000, 999999));
// set transient for 30 minutes
set_transient('ai_botkit_onboarding_nonce', $nonce, 60 * 30);
global $ai_botkit_url;

$site_url = rawurlencode(get_site_url());
$iframe_src = "{$ai_botkit_url}/onboarding/wordpress?siteUrl={$site_url}&nonce={$nonce}";

?>
<div class="ai-botkit-new-dashboard">
    <div class="ai-botkit-dashboard-header">
        <img src="<?php echo esc_url(plugins_url('../logo.png', __FILE__)); ?>" alt="AI BotKit Logo" class="ai-botkit-logo">
    </div>
    <div class="ai-botkit-onboarding-container">
        <iframe src="<?php echo esc_url($iframe_src); ?>" width="100%" style="height: 100vh;" frameborder="0"></iframe>
    </div>
</div>
