import React from 'react'; import { SessionModal } from './SessionModal'; import { SessionButton, SessionButtonColor } from './SessionButton'; import { SessionHtmlRenderer } from './SessionHTMLRenderer'; import { SessionIcon, SessionIconSize, SessionIconType } from './icon'; import { DefaultTheme, withTheme } from 'styled-components'; type Props = { message: string; messageSub: string; title: string; onOk?: any; onClose?: any; onClickOk: any; onClickClose: any; okText?: string; cancelText?: string; hideCancel: boolean; okTheme: SessionButtonColor; closeTheme: SessionButtonColor; sessionIcon?: SessionIconType; iconSize?: SessionIconSize; theme: DefaultTheme; }; const SessionConfirmInner = (props: Props) => { const { title = '', message, messageSub = '', okTheme = SessionButtonColor.Primary, closeTheme = SessionButtonColor.Primary, onClickOk, onClickClose, hideCancel = false, sessionIcon, iconSize, } = props; const okText = props.okText || window.i18n('ok'); const cancelText = props.cancelText || window.i18n('cancel'); const showHeader = !!props.title; const messageSubText = messageSub ? 'session-confirm-main-message' : 'subtle'; return ( {!showHeader &&
}
{sessionIcon && iconSize && ( <>
)}
{!hideCancel && ( )}
); }; export const SessionConfirm = withTheme(SessionConfirmInner);