Aurora Admin v1.2.0: 79 components x 5 ends, doc site, contracts batch 1, playground, regression, deploy ready
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import './AlertModal.css';
|
||||
|
||||
const ICON = { success: '✓', error: '✕', warning: '!', info: 'i' };
|
||||
|
||||
export default function AlertModal({ visible = false, type = 'info', title = '提示', content = '', okText = '知道了', onOk }) {
|
||||
if (!visible) return null;
|
||||
return (
|
||||
<div className="aa-modal-mask" onClick={e => { if (e.target === e.currentTarget) onOk && onOk(); }}>
|
||||
<div className={`aa-alert is-${type}`}>
|
||||
<div className="aa-alert-head">
|
||||
<span className="aa-alert-icon">{ICON[type] || 'i'}</span>
|
||||
<div className="aa-alert-title">{title}</div>
|
||||
</div>
|
||||
<div className="aa-alert-content">{content}</div>
|
||||
<div className="aa-alert-footer">
|
||||
<button className="aa-alert-btn" onClick={onOk}>{okText}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user