UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

26 lines (25 loc) 1.22 kB
/** * CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24 * Update:: import { ISourceProps } to '@mikezimm/fps-core-v7/lib/components/molecules/source-props/ISourceProps;' */ import * as React from 'react'; import { Icon } from '@fluentui/react/lib/Icon'; /** * https://github.com/mikezimm/fps-library-v2/issues/190 * * @param props * @returns */ export function GetGoToListLink(props) { const { primarySource, showListLink, listLinkCSS } = props; const { webUrl, webRelativeLink, listTitle, } = primarySource; const linkCSS = listLinkCSS ? { ...CommonLinkCSS, ...listLinkCSS } : CommonLinkCSS; const gotoListLink = showListLink === false || !webRelativeLink ? undefined : React.createElement("div", { className: CommonClasses.join(' '), onClick: () => { window.open(`${webUrl}/${webRelativeLink}`, '_blank'); }, style: linkCSS }, !listTitle ? `Open list ` : `Open ${listTitle}`, " ", React.createElement(Icon, { iconName: 'OpenInNewTab' })); return gotoListLink; } export const CommonClasses = ['fps-gen-inBlockNoWrap', 'fps-gen-goToLink']; export const CommonLinkCSS = { fontWeight: 600 }; //# sourceMappingURL=GetGoToListLink.js.map