import { IconButton, PrimaryButton } from "@fluentui/react"; import React, { FunctionComponent, ReactNode } from "react"; import ErrorRedIcon from "../../../../images/error_red.svg"; import LoadingIndicatorIcon from "../../../../images/LoadingIndicator_3Squares.gif"; import { KeyCodes } from "../../../Common/Constants"; export interface GenericRightPaneProps { expandConsole: () => void; formError: string; formErrorDetail: string; id: string; isExecuting: boolean; onClose: () => void; onSubmit: () => void; submitButtonText: string; title: string; isSubmitButtonHidden?: boolean; children?: ReactNode; } export const GenericRightPaneComponent: FunctionComponent = ({ expandConsole, formError, formErrorDetail, id, isExecuting, onClose, onSubmit, submitButtonText, title, isSubmitButtonHidden, children, }: GenericRightPaneProps) => { const getPanelHeight = (): number => { const notificationConsoleElement: HTMLElement = document.getElementById("explorerNotificationConsole"); return window.innerHeight - $(notificationConsoleElement).height(); }; const panelHeight: number = getPanelHeight(); const renderPanelHeader = (): JSX.Element => { return (
{title}
); }; const renderErrorSection = (): JSX.Element => { return ( ); }; const renderPanelFooter = (): JSX.Element => { return (
); }; const renderLoadingScreen = (): JSX.Element => { return ( ); }; const onKeyDown = (event: React.KeyboardEvent): void => { if (event.keyCode === KeyCodes.Escape) { onClose(); event.stopPropagation(); } }; return (
{renderPanelHeader()} {renderErrorSection()} {children} {renderPanelFooter()}
{renderLoadingScreen()}
); };