import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import './styles/main.scss';
import './utils/Helpers.js'; // Load layout helpers

// Initialize React app when DOM is ready
document.addEventListener('DOMContentLoaded', function() {
    const container = document.getElementById('wcps-admin-styles');
    if (container) {
        // Get initial data from container attributes
        const editId = container.getAttribute('data-edit-id');
        const view = container.getAttribute('data-view');
        
        const root = createRoot(container);
        root.render(<App editId={editId} initialView={view} />);
    }
});