import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import './index.css';
const path = window.location.pathname;
if (path.startsWith('/app')) {
// Clear the body and add root div
document.body.innerHTML = '
';
const rootElement = document.getElementById('root');
if (rootElement) {
createRoot(rootElement).render(
);
}
} else {
// We are on the landing page, inject the login button
const nav = document.getElementById('nav-menu');
if (nav) {
const loginBtn = document.createElement('a');
loginBtn.href = '/app';
loginBtn.className = 'btn';
loginBtn.style.marginLeft = '10px';
loginBtn.style.backgroundColor = '#444';
loginBtn.innerHTML = ' Área do Cliente';
nav.appendChild(loginBtn);
}
}