@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
29 lines (28 loc) • 1.38 kB
JavaScript
/**
* 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';
import { CommonLinkCSS, CommonClasses } from './GetGoToListLink';
/**
* https://github.com/mikezimm/fps-library-v2/issues/190
*
* @param props
* @returns
*/
export function GetGoToWebLink(props) {
const { primarySource, showWebLink, webLinkCSS, showWebIcon, altWebText } = props;
const { webUrl, } = primarySource;
// Copied from SourcePages in Compliance
const defaultWebCSS = { color: 'black', fontSize: 'large', paddingBottom: '10px' };
const linkCSS = webLinkCSS ? { ...CommonLinkCSS, ...defaultWebCSS, ...webLinkCSS } : { ...CommonLinkCSS, ...defaultWebCSS };
const gotoWebLink = showWebLink === false || !webUrl ? undefined : React.createElement("div", { className: CommonClasses.join(' '), onClick: () => { window.open(primarySource.webUrl, '_blank'); }, style: linkCSS },
altWebText ? altWebText : `Site Url: `,
" ",
primarySource.webUrl,
" ",
showWebIcon === true ? React.createElement(Icon, { iconName: 'OpenInNewTab' }) : undefined);
return gotoWebLink;
}
//# sourceMappingURL=GetGoToWebLink.js.map