import * as React from 'react' ; import { Link } from 'azure-devops-ui/Link' ; export const tryLink = ( fHref , inner , className ? , onClick ? ) => { try { const href = fHref ( ) ; if ( ! href ) throw null ; return < Link className = { className } excludeTabStop href = { fHref ( ) } target = "_blank" onClick = { onClick } > { inner } < /Link>; } catch ( e ) { return inner ; } } ; export function tryOr < T = any > ( ... functions ) { for ( const func of functions ) { if ( typeof func !== 'function' ) return func as T ; try { const value = func ( ) ; if ( ! value ) continue ; return value as T ; } catch ( e ) { } } }