import React from 'react'; import CommentWidget from './comment/CommentWidget' import TagWidget from './tag/TagWidget'; import WrappedWidget from './WrappedWidget'; /** Standard widgets included by default **/ const BUILTIN_WIDGETS = { COMMENT: , TAG: }; /** Defaults to use if there's no overrides from the host app **/ export const DEFAULT_WIDGETS = [ , ] export const getWidget = arg => { if (typeof arg === 'string' || arg instanceof String) { return BUILTIN_WIDGETS[arg]; } else if (typeof arg === 'function' || arg instanceof Function) { return } else if (React.isValidElement(arg)) { return arg; } else { throw `${arg} is not a valid plugin` } }