
    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Upgrade Required</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background-color: #404040;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        }
        .message {
            color: #c0c0c0;
            font-size: 24px;
            text-align: center;
            padding: 20px;
        }
        a {
          color: #c0c0c0;
        }
        .logo img {
          margin-bottom: 20px;
          width: 80px;
          height: 80px;
        }
    </style>
</head>
<body>
    <script>
        // Fetch whitelabel config from API
        async function loadWhitelabelConfig() {
            try {
                const response = await fetch(`https://famous.ai/api/whitelabel/wlupgrade?url=${encodeURIComponent(window.location.href)}`);

                if (!response.ok) {
                    throw new Error(`HTTP error! status: ${response.status}`);
                }

                const config = await response.json();
                const logo = config.logo;
                const domain = config.domain;

                // Create logo section if both logo and domain are present
                if (logo && domain) {
                    const logoDiv = document.createElement('div');
                    logoDiv.className = 'logo';
                    logoDiv.innerHTML = `
                        <a href="https://${domain}" target="_blank">
                            <img src="${logo}" alt="${domain}" />
                        </a>
                    `;
                    document.body.appendChild(logoDiv);
                }

                // Create message section
                const messageDiv = document.createElement('div');
                messageDiv.className = 'message';

                if (domain) {
                    // If domain is present, create link
                    messageDiv.innerHTML = `
                        <a href="https://${domain}/dashboard#billing" target="_blank">Upgrade now</a> to host your site at this domain
                    `;
                } else {
                    // If domain is missing, just show text without link
                    messageDiv.textContent = 'Upgrade now to host your site at this domain';
                }

                document.body.appendChild(messageDiv);
            } catch (error) {
                console.error('Error fetching whitelabel config:', error);

                // Fallback: show basic message without logo
                const messageDiv = document.createElement('div');
                messageDiv.className = 'message';
                messageDiv.textContent = 'Upgrade now to host your site at this domain';
                document.body.appendChild(messageDiv);
            }
        }

        // Load the config when the page loads
        loadWhitelabelConfig();
    </script>
</body>
</html>


    