web-llm-embed / src /pages /api /home.context.tsx
matt HOFFNER
barebones
b9d9891
raw
history blame
644 Bytes
import { Dispatch, createContext } from 'react';
import { ActionType } from '@/utils/';
import { Conversation } from '@/types/chat';
import { KeyValuePair } from '@/types/data';
import { HomeInitialState } from './home.state';
export interface HomeContextProps {
state: HomeInitialState;
dispatch: Dispatch<ActionType<HomeInitialState>>;
handleNewConversation: () => void;
handleSelectConversation: (conversation: Conversation) => void;
handleUpdateConversation: (
conversation: Conversation,
data: KeyValuePair,
) => void;
}
const HomeContext = createContext<HomeContextProps>(undefined!);
export default HomeContext;