import { DrawerProvider, Header } from "@/components/layout";
import { loadChatsList } from "@/entities/chats/loaders";

import styles from "./layout.module.scss";

export default function CoreLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <DrawerProvider>
      <Header className={styles.navBar} chatsPromise={loadChatsList()} />
      <main className={styles.main}>{children}</main>
    </DrawerProvider>
  );
}
