import { createElement, createRoot } from '@wordpress/element';

import AdminApp from './app/AdminApp';
import type { AdminData } from './app/admin-data';
import './app/admin/styles/product.scss';

declare global {
	interface Window {
		scheduledChangesAdmin?: AdminData;
	}
}

const root = document.getElementById( 'scheduled-changes-admin-root' );

if ( root ) {
	createRoot( root ).render(
		createElement( AdminApp, {
			data: window.scheduledChangesAdmin || {},
		} )
	);
}
