PromucFlow_constructor/app/client/src/components/editorComponents/InputComponent.tsx
Satish Gandham 7f7f6f666b
Development: Add eslint rules for code consistency (#4083)
Co-authored-by: Satish Gandham <satish@appsmith.com>
Co-authored-by: Abhinav Jha <abhinav@appsmith.com>
2021-04-28 15:58:39 +05:30

38 lines
951 B
TypeScript

import React from "react";
import styled from "styled-components";
import { Intent as BlueprintIntent, InputGroup } from "@blueprintjs/core";
import { Intent, BlueprintInputTransform } from "constants/DefaultTheme";
import { WrappedFieldInputProps } from "redux-form";
const StyledInputGroup = styled(InputGroup)`
&&& {
${BlueprintInputTransform};
}
`;
export type InputType = "text" | "password" | "number" | "email" | "tel";
type InputComponentProps = {
placeholder: string;
input: Partial<WrappedFieldInputProps>;
type?: InputType;
intent?: Intent;
disabled?: boolean;
autoFocus?: boolean;
};
function InputComponent(props: InputComponentProps) {
return (
<StyledInputGroup
{...props.input}
autoFocus={props.autoFocus}
disabled={props.disabled}
intent={props.intent as BlueprintIntent}
placeholder={props.placeholder}
type={props.type}
/>
);
}
export default InputComponent;