/** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; import { RcButton, RcButtonProps } from '../foundation'; import { RcModal, RcModalProps } from '../layout'; export interface RcModalYesNoProps extends RcModalProps { onYes?: (event: React.MouseEvent) => void; onNo?: (event: React.MouseEvent) => void; txtYes?: string; txtNo?: string; message?: string; colorNo?: string; noAtLeft?: boolean; msgBtnGap?: string; btnWidth?: string; leftButtonStyle?: RcButtonProps; rightButtonStyle?: RcButtonProps; } export const RcModalYesNo: React.FC = ({ onYes, onNo, title = 'Confirmation', txtYes = 'YES', txtNo = 'NO', message, colorNo = '#e62739', noAtLeft, msgBtnGap = '30px', btnWidth, children, leftButtonStyle, rightButtonStyle, ...rest }) => { return (
{message ? (

{message}

) : ( children )}
{ if (rest.onClose) { rest.onClose(); } if (onYes) { onYes(e); } }} outline={true} color={colorNo} width={btnWidth} {...leftButtonStyle} > {txtYes} { if (rest.onClose) { rest.onClose(); } if (onNo) { onNo(e); } }} outline={true} width={btnWidth} {...rightButtonStyle} > {txtNo}
); };