import React from 'react'; import { ActionIcon, Center, CopyButton, Divider, Group, MantineSize, Modal, Space, Text, Title, Tooltip } from '@mantine/core'; import { VisynEnv } from '../../base/VisynEnv'; import { generateVersionInfo } from '../../base/versionInfoUtils'; import { useVisynAppContext } from '../VisynAppContext'; /** * Configuration for the about app modal. Can * be used to define size, content and bottom section. */ export interface IAboutAppModalConfig { // Middle section of the modal content?: JSX.Element; // Bottom section of the modal bottom?: JSX.Element; customerLogo?: JSX.Element; size?: MantineSize | number | string; } export function AboutAppModalBottom({ appName, customerLogo, dvLogo }: { appName: string | JSX.Element; customerLogo?: JSX.Element; dvLogo?: JSX.Element }) { return (
{appName || 'This application '} is developed by{' '}
{customerLogo} {customerLogo ? : null} {dvLogo}
); } export function AboutAppModal({ size = 'md', content, opened, onClose, dvLogo = undefined, bottom, customerLogo = undefined, }: { opened: boolean; onClose: () => void; dvLogo?: JSX.Element; customerLogo?: JSX.Element; } & IAboutAppModalConfig) { const { appName } = useVisynAppContext(); return ( {appName} } size={size} > {content} {VisynEnv.__VERSION__ ? ( Version: {VisynEnv.__VERSION__} {VisynEnv.__BUILD_ID__ ? ` (${VisynEnv.__BUILD_ID__})` : ''} ) : null} {({ copied, copy }) => ( { copy(); }} style={{ pointerEvents: 'all' }} > {copied ? : } )} {bottom === undefined ? : bottom} ); }