import { useEffect, createRef, CSSProperties } from 'react'; export default (props:{ value?:string, defaultValue?:string, type?:string, id?:string, title?:string, direction?:string, style?:CSSProperties, sup?:string, lefticon?:any, ilm?:number |string, nolefticonrotate?:boolean, onlefticon?:()=>void, deltxt?:boolean, on?:(string)=>void, padding?:number | string, margin?:number |string, fontSize?:number | string, txtdir?:string, textAlign?:string, dir?:string, readOnly?:boolean, placeholder?:string, onenter?:()=>void, onclick?:()=>void, onrighticon?:()=>void, righticon?:any, righttext?:string, norighticonrotate?:boolean, sr?:number }) => { var defaultValue = null; var inp = createRef(); if (typeof props.value != "undefined") { defaultValue = props.value } if (typeof props.defaultValue != "undefined") { defaultValue = props.defaultValue } let selected = false; if (props.type == "currency" && defaultValue && (defaultValue.length > 0 || defaultValue > 0)) { var num = parseFloat(defaultValue.toString().split(",").join("")); if (isNaN(num)) { defaultValue = "0"; } else { defaultValue = num.toLocaleString("en-US") } } useEffect(() => { if (typeof window != "undefined") { setTimeout(() => { let inp = document.getElementById(props.id ? props.id : props.title) as HTMLTextAreaElement if (inp) inp.defaultValue = defaultValue || "" }, 300); } }); return
{props.title}{props.sup}
{typeof props.lefticon == "string" ? <> { props.onlefticon?.() }} />  : props.lefticon} {props.deltxt ? { let inp = document.getElementById(props.id ? props.id : props.title) inp.value = ""; props.on?.(""); }} /> : null}