/** * This component is a template for a modal dialog that wraps the application style */ import React, { ReactNode } from 'react'; import Modal from 'react-modal'; import { useTranslation } from 'react-i18next'; import { Loader } from './loader'; import CustomAssetAPI from '../api/custom-asset'; Modal.setAppElement('body'); interface FabModalProps { title: string, isOpen: boolean, toggleModal: () => void, confirmButton?: ReactNode } const blackLogoFile = CustomAssetAPI.get('logo-black-file'); export const FabModal: React.FC = ({ title, isOpen, toggleModal, children, confirmButton }) => { const { t } = useTranslation('shared'); const blackLogo = blackLogoFile.read(); /** * Check if the confirm button should be present */ const hasConfirmButton = (): boolean => { return confirmButton !== undefined; } return (
{blackLogo.custom_asset_file_attributes.attachment}

{ title }

{children}
{hasConfirmButton() && {confirmButton}}
); }