import { createStore } from './store'; export type ITextAskState = { inputText: string; }; export type TextAskStoreValue = Record; const initialTextAskStoreValue: TextAskStoreValue = {}; export const textAskWidgetStore = createStore(initialTextAskStoreValue); export type IUpdateTextAskInputTextAction = { widgetId: string; inputText: string; }; export const textAskWidgetStoreActions = { updateTextAskInputTextAction({ widgetId, inputText, }: IUpdateTextAskInputTextAction) { textAskWidgetStore.set({ ...textAskWidgetStore.get(), [widgetId]: { inputText, }, }); }, };