@botonic/plugin-flow-builder
Version:
Use Flow Builder to show your contents
12 lines (9 loc) • 382 B
text/typescript
import { createContext } from 'react'
import { MapContentsType, WebviewContentsContextType } from './types'
export const createWebviewContentsContext = <T extends MapContentsType>() =>
createContext<WebviewContentsContextType<T>>({
getTextContent: () => '',
getImageSrc: () => '',
setCurrentLocale: () => undefined,
contents: {} as Record<keyof T, string>,
})