import { ToastContainer } from "react-toastify";
import { render } from "./app.ts";
import { useEffect } from "react";

export const AppProvider = () => {
  return (
    <>
      <ToastContainer autoClose={2000}></ToastContainer>
      <App />
    </>
  );
};

export const App = () => {
  useEffect(() => {
    const cleanup = render();
    return () => {
      cleanup?.();
    };
  }, []);

  return (
    <div
      id='container'
      style={{
        width: '100vw',
        height: '100vh',
        overflow: 'hidden',
        margin: 0,
        padding: 0,
        position: 'fixed',
        top: 0,
        left: 0
      }}
    />
  );
};
