mirror of
https://github.com/StanGirard/quivr.git
synced 2025-01-07 11:39:00 +03:00
16 lines
427 B
TypeScript
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>
|
||
|
);
|
||
|
};
|