starchat-ui / components /Promptbar /PromptBar.context.tsx
matthoffner's picture
Duplicate from matthoffner/chatbot
13095e0
raw
history blame
580 Bytes
import { Dispatch, createContext } from 'react';
import { ActionType } from '@/hooks/useCreateReducer';
import { Prompt } from '@/types/prompt';
import { PromptbarInitialState } from './Promptbar.state';
export interface PromptbarContextProps {
state: PromptbarInitialState;
dispatch: Dispatch<ActionType<PromptbarInitialState>>;
handleCreatePrompt: () => void;
handleDeletePrompt: (prompt: Prompt) => void;
handleUpdatePrompt: (prompt: Prompt) => void;
}
const PromptbarContext = createContext<PromptbarContextProps>(undefined!);
export default PromptbarContext;