import React from "react"; import * as R from "ramda"; import { compose, withHandlers } from "recompose"; const OnlyLabelName = ({ labelName }: { labelName?: string }) => ( ); const RequiredLabelName = ({ labelName, requiredFieldText }: { labelName?: string; requiredFieldText?: string; }) => ( ); export type InputProps = { value: number | string; update: any; inputClassName?: string; id?: string; labelName?: string; disabled?: boolean; readOnly?: boolean; autoComplete?: string; requiredFieldText?: string; placeholder?: string; }; export type OutputProps = InputProps & { change: any; }; const NumericInput = ({ value, change, inputClassName = "", id = "arkTextInput", labelName, readOnly = false, disabled = false, autoComplete = "on", requiredFieldText, placeholder = "" }: OutputProps) => ( <> {!R.isEmpty(labelName) && R.isEmpty(requiredFieldText) ? ( ) : null} {!R.isEmpty(labelName) && !R.isEmpty(requiredFieldText) ? ( ) : null} ); export default compose( withHandlers({ change: ({ update }: { update: any }) => (e: any) => update(e.target.value) }) )(NumericInput);