26 lines
698 B
TypeScript
26 lines
698 B
TypeScript
import { createContext } from 'react';
|
|
import { ILlmInitAction } from '../common/interfaces';
|
|
import { PromptsList } from '../common/adminApiUtil';
|
|
|
|
export interface ResponseHistory {
|
|
answer: string;
|
|
userPrompt: string;
|
|
editPrompt?: string;
|
|
prevAnswer?: string;
|
|
}
|
|
|
|
export interface IModalContext extends ILlmInitAction {
|
|
title: string;
|
|
initPrompt: string;
|
|
objectPrompts: PromptsList[];
|
|
responses: ResponseHistory[];
|
|
showResponseIndex: number;
|
|
editMode: boolean;
|
|
loadingResponse: boolean;
|
|
loading: boolean;
|
|
targetContent: string;
|
|
updateState: (data: Partial<IModalContext>) => void;
|
|
}
|
|
|
|
export const ModalContext = createContext<IModalContext | null>(null);
|