@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
31 lines (29 loc) • 2.01 kB
JavaScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52
* Update:: import { IMinTeachBubble } to '@mikezimm/fps-core-v7/lib/components/atoms/TeachBubble/IMinTeachBubble;'
*/
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24
* Update:: import { check4This } to '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch;'
*/
import * as React from 'react';
import { TeachingBubble } from '@fluentui/react/lib/TeachingBubble';
import { check4This } from '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function makeBubbleElementFromBubbles(teachBubble, TeachBubbleArray, setTeachBubble, closeTour) {
if (teachBubble === null || TeachBubbleArray.length === 0) {
if (check4This(`showBubbles=true`) === true)
console.log('makeBubbleElementFromBubbles not started', teachBubble, TeachBubbleArray);
return null;
}
const theBubble = TeachBubbleArray[teachBubble];
const nextBubble = teachBubble === TeachBubbleArray.length - 1 ? 0 : teachBubble + 1;
const prevBubble = teachBubble === 0 ? TeachBubbleArray.length - 1 : teachBubble - 1;
// console.log( `HomeTeachingBubbles:` , teachBubble , nextBubble, prevBubble );
const Bubble = React.createElement("div", null,
React.createElement(TeachingBubble, { target: theBubble.target, hasCloseButton: true, headline: theBubble.headline, onDismiss: () => { closeTour(); }, primaryButtonProps: { text: `${'Next'}`, onClick: () => setTeachBubble(nextBubble) }, secondaryButtonProps: { text: `${'Previous'}`, onClick: () => setTeachBubble(prevBubble) }, footerContent: `${teachBubble + 1} of ${TeachBubbleArray.length}` },
!theBubble.message ? null : React.createElement("div", null, `${theBubble.message}`),
!theBubble.content ? null : React.createElement("div", null, `${theBubble.content}`)));
return Bubble;
}
//# sourceMappingURL=component.js.map