import React from "react"; import classNames from "classnames"; import { Loading } from "../loading/loading"; import { Button } from "../enhanced/button"; export interface RLFSectionProps { id?: string; className?: string; title?: string; sectionKey?: string; data?: any; children?: any; submit?: any; loading?: boolean; onSubmit?: Function | null; } export const RLFSection: React.SFC = ( props: RLFSectionProps ) => { const getTitle = (): JSX.Element | null => { if (props.title) { return (

{props.title}

); } return null; }; const getSubmitButton = (): JSX.Element | null => { if (props.sectionKey && props.submit && props.submit[props.sectionKey]) { const handleOnSubmit = (): any => { const onSubmit: Function = props.onSubmit ? props.onSubmit : (e: any) => {}; if (!props.loading) { onSubmit(props.sectionKey); } }; const label: string = props.title ? `Submit ${props.title}` : "Submit"; return (