import Copy from './Copy' import Link from 'next/link' import AbbreviateEnd from './TextEndAbbreviation' import Bold from './Bold' export default (props: { value?: any, body?: any, text?: any, copy?: string, abbreviatemid?: number, abbreviatend?: number, bold?: boolean, href?: string, target?: string, nexthref?: string, islink?: boolean, vfontSize?: number, fontSize?: number | string, fontWeight?: number | string, on?: () => void, wlink?: string, wbold?: boolean, whighlight?: boolean, whref?: string, wtarget?: string, wnexthref?: string, onwlink?: () => void, title?: string, nospace?: boolean, image?: any, icon?: string, titlemb?: number, s?: number | string, extlink?: boolean, vmarginTop?: number | string, onimage?: () => void, imb?: number | string, bgcolor?:string, highlight?:boolean, vdir?:string, tmb?:number | string, valuecolor?:string, help?:boolean, onhelp?:()=>void, }) => { var value = null; let textstring = true if (typeof props.value != "undefined") { value = props.value } if (typeof props.body != "undefined") { value = props.body } if (typeof props.text != "undefined") { value = props.text } if (typeof value != "string") { textstring = false } var copy = props.copy if (props.abbreviatemid) { if (value.length > props.abbreviatemid) { var up = value.substr(0, (props.abbreviatemid / 2 - 3)) var down = value.substr(value.length - (props.abbreviatemid / 2 - 3)) value = up + "..." + down } } if (props.abbreviatend) { value = AbbreviateEnd(value, props.abbreviatend) } var text = value; if (props.bold) { text = {text} } if (props.href) { if (props.target) { text = {text} } else { text = {text} } } else if (props.nexthref) { text = {text} } else if (props.islink) { text = {text} } if (textstring) { text =
{ props.on ? props.on() : null }}>{text}
} var wmb = 0 var wlink = props.wlink ? {props.wlink} : "" if (props.wbold) { wlink = {wlink} } if (props.whref) { if (props.wtarget) { wlink = {wlink} } else { wlink = {wlink} } } else if (props.wnexthref) { wlink = {wlink} } else { wlink = {wlink} } wlink =
{ props.onwlink ? props.onwlink() : null }}>{wlink}
return {props.title ? {props.title} : null} {props.nospace ? : null} {props.image && typeof props.image == "string" ? {props.title { props.onimage?.() }} /> : null} {props.image && typeof props.image != "string" ? props.image : null} {textstring ? {text} : text} {props.extlink ? <>ext link : null} {copy ? <>copy { Copy(copy); alerter(lang.copied) }} /> : null} {wlink} {props.help || props.onhelp ? <>help { props.onhelp?.() }} /> : null} }