quivr/frontend/lib/context/ChatsProvider/chats-provider.tsx
Zineb El Bachiri f4aa22417f
Refactor/front (#313)
* 🚚 move footer component

* 🚚 move navbar component

* 🚚 move ui components

* 🚚 move browser tab icon to public folder

* 🚚 move Chat Provider

* 🚚 move hooks to lib

* 🚚  move helpers to lib

* 🚚 move types to lib
2023-06-13 16:33:41 +02:00

16 lines
427 B
TypeScript

"use client";
import { createContext } from "react";
import useChats from "./hooks/useChats";
import { ChatsState } from "./types";
export const ChatsContext = createContext<ChatsState | undefined>(undefined);
export const ChatsProvider = ({ children }: { children: React.ReactNode }) => {
const chatsState = useChats();
return (
<ChatsContext.Provider value={chatsState}>{children}</ChatsContext.Provider>
);
};