@tycoonsystems/tycoon-modules
Version:
www.tv.tycoon.systems/documentation
1 lines • 4.68 kB
JavaScript
import React from"react";import Tooltip from"@mui/material/Tooltip";import InternalStyles from"./Internal.module.scss";const Module=s=>{var[,,]=React.useState(!1),[,,]=React.useState({});const[e,t]=React.useState([]),[a,n]=React.useState([]),[o,r]=React.useState([]),[i,l]=React.useState([]);return React.useEffect(()=>{var e;s.paymentConfig?(e=[],s.paymentConfig.keys&&(s.paymentConfig.keys.stripe||e.push({m:"Stripe key is not defined. You will not be able to process purchases in regions supported by Stripe https://stripe.com/en-ca/global",s:"Add your Stripe key to the config under paymentConfig.keys.stripe"}),s.paymentConfig.keys.stripe||e.push({m:"Paystack key is not defined. You will not be able to process purchases in regions supported by Paystack https://paystack.com/countries",s:"Add your Paystack key to the config under paymentConfig.keys.paystack"})),t(e)):t([{m:"Payment Config is not defined. Please set in config file",s:"In order for the payment processor to function properly you must add Payment Configurations to resolveVariables as paymentConfig {Object}"}])},[s?.paymentConfig]),React.useEffect(()=>{var e;s.helpIndex?(e=[],Array.isArray(s.helpIndex)||e.push({m:"The Help Index is not of an Array type. Please ensure that it is of an array type.",s:"Array Item Model: question {String}, answer {String}, a {String}, pinned {Boolean} (optional) Default False. In order for leverage quick FAQ capabilities for your business you must add Help Index to resolveVariables as helpIndex [ ...{Object} ]"}),n(e)):n([{m:"Help Index is not defined. Please set in config file",s:"In order for leverage quick FAQ capabilities for your business you must add Help Index to resolveVariables as helpIndex [ ...{Object} ]"}])},[s?.helpIndex]),React.useEffect(()=>{var e,t;s.settingsConfig?(e=[],s.settingsConfig.tabs?Array.isArray(s.settingsConfig.tabs)?-1<(t=s.settingsConfig.tabs.findIndex(e=>!e.items??!1))&&e.push({m:`A tab in the settingsConfig.tabs array does not have an appropriate config. Please ensure that the tab ${t} has a property of type Array[ ...{Object} ].`,s:"In order for users to access the settings page for your business you must add Settings Config to resolveVariables as settingsConfig {Object} and then create an array at settingsConfig.tabs Array[ ...{Object} ]"}):e.push({m:"The settingsConfig.tabs property is not of an Array type. Please ensure that it is of an array type.",s:"In order for users to access the settings page for your business you must add Settings Config to resolveVariables as settingsConfig {Object} and then create an array at settingsConfig.tabs Array[ ...{Object} ]"}):e.push({m:"The Settings Config does not have a tabs property. Please ensure that it has a tabs property under settingsConfig.tabs of type Array[ ...{Object} ]. Each tab must have an items Array[ ...{Object} ]. It may have an label {String} and avatar {Boolean}",s:"In order for users to access the settings page for your business you must add Settings Config to resolveVariables as settingsConfig {Object}"}),r(e)):r([{m:"Settings Config is not defined. Please set in config file",s:"In order for users to access the settings page for your business you must add Settings Config to resolveVariables as settingsConfig {Object}"}])},[s?.settingsConfig]),React.useEffect(()=>{var e;s.menuConfig?(e=[],Object.prototype.hasOwnProperty.call(s.menuConfig,"height")||e.push({m:"The Menu Config does not have a height property. Setting a height property on your Menu Config will ensure that all floating and static elements load at the correct height such that they do not block the users interaction height {Number}",s:"The internal menu allows for the users to easily navigate the platform using proprietary modules. You must add the Menu Config to resolveVariables as menuConfig {Object}"}),r(e)):r([{m:"Menu Config is not defined. Please set in config file",s:"The internal menu allows for the users to easily navigate the platform using proprietary modules. You must add the Menu Config to resolveVariables as menuConfig {Object}"}])},[s?.menuConfig]),React.useEffect(()=>{l([].concat(e,o,a))},[e,o,a]),React.createElement(React.Fragment,null,s?.dev&&0<i.length?React.createElement("div",{className:InternalStyles.devContainer+" "+s.className},React.createElement("div",{className:""+InternalStyles.devInternalContainer},React.createElement("div",{style:{marginBottom:".5rem",fontSize:".85rem"}},"Developer"),React.createElement("div",{className:""+InternalStyles.devLogContainer},i.map(e=>React.createElement("div",null,React.createElement(Tooltip,{title:e.s,placement:"right"},React.createElement("div",null,"* ",e.m))))))):null)};export default Module;