import { IOConnectProvider } from "@interopio/react-hooks";
import { LaunchpadBody, LaunchpadHeader, LaunchpadContentsContainer, PlatformPrefsProvider } from "@interopio/home-ui-react";
import { ioConfig } from "./constants";
import { ThemeProvider, IONotifications } from "@interopio/components-react";
import Logo from "../components/logo";
import NotificationsButton from "../components/notifications-button";
import MainContextMenu from "../components/main-context-menu";
import "@interopio/workspaces-ui-react/dist/styles/workspaces.css";
import "@interopio/home-ui-react/index.css";

export function App() {
    const { NotificationsProvider } = IONotifications;

    return (
        <IOConnectProvider settings={ioConfig}>
            <PlatformPrefsProvider>
                <ThemeProvider>
                    <NotificationsProvider>
                        <LaunchpadContentsContainer
                            components={{
                                header: {
                                    BeforeSearch: () => <Logo />,
                                    AfterSearch: () => (
                                        <>
                                            <NotificationsButton />
                                            <MainContextMenu />
                                        </>
                                    )
                                }
                            }}
                        >
                            <LaunchpadHeader />
                            <LaunchpadBody />
                        </LaunchpadContentsContainer>
                    </NotificationsProvider>
                </ThemeProvider>
            </PlatformPrefsProvider>
        </IOConnectProvider>
    );
}

export default App;