Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from "react";
- import PropTypes from "prop-types";
- import classnames from "classnames";
- import { translate } from "react-i18next";
- import {
- Form,
- Input,
- Select,
- DynamicInputField,
- } from "@ematix/tesseract-component-library";
- import cls from "./styles.scss";
- class FormIdentification extends React.PureComponent {
- render() {
- const { className, t, ...rest } = this.props;
- const type = [];
- const Type = ({ rowKey, name }) => (
- <Select
- className={cls.selectType}
- label={t("Document Type")}
- name={`${name}[${rowKey}][type]`}
- options={type}
- searchable={false}
- />
- );
- const DocumentId = ({ rowKey, name }) => (
- <Input
- className={cls.inputDocumentId}
- name={`${name}[${rowKey}][documentid]`}
- label={t("Document ID")}
- />
- );
- const IssueDate = ({ rowKey, name }) => (
- <Input
- className={cls.inputIssueDate}
- name={`${name}[${rowKey}][issueDate]`}
- label={t("Issue Date")}
- />
- );
- const ExpiryDate = ({ rowKey, name }) => (
- <Input
- className={cls.inputExpiryDate}
- name={`${name}[${rowKey}][expiryDate]`}
- label={t("Expiry Date")}
- />
- );
- const Authority = ({ rowKey, name }) => (
- <Input
- className={cls.inputAuthority}
- name={`${name}[${rowKey}][authority]`}
- label={t("Authority/Issuer")}
- />
- );
- const TypeAndDocumentId = props => (
- <div className={cls.TypeAndDocument}>
- <Type {...props} />
- <DocumentId {...props} />
- </div>
- );
- return (
- <Form
- className={classnames(className, cls.form)}
- {...rest}
- onSubmit={() => {}}
- >
- <div className={cls.university}>
- <DynamicInputField
- name="fields"
- className={cls.inputFields}
- fields={[TypeAndDocumentId, IssueDate, ExpiryDate, Authority]}
- />
- </div>
- </Form>
- );
- }
- }
- FormIdentification.propTypes = {
- className: PropTypes.string,
- };
- FormIdentification.defaultProps = {
- className: null,
- };
- FormIdentification.propTypes = { t: PropTypes.func.isRequired };
- export default translate("FormIdentification")(FormIdentification);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement