Add MessageDialogView component for displaying messages.
This commit is contained in:
parent
c03a47a833
commit
0a780b6d85
40
src/components/Dashboard/common/MessageDialogView.jsx
Normal file
40
src/components/Dashboard/common/MessageDialogView.jsx
Normal file
@ -0,0 +1,40 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { Flex, Typography, Button } from 'antd'
|
||||
import InfoCircleIcon from '../../Icons/InfoCircleIcon.jsx'
|
||||
|
||||
const { Text } = Typography
|
||||
|
||||
const MessageDialogView = ({
|
||||
icon,
|
||||
title,
|
||||
description,
|
||||
onOk,
|
||||
okText,
|
||||
okLoading
|
||||
}) => {
|
||||
return (
|
||||
<Flex vertical gap={'middle'}>
|
||||
<Flex gap={'middle'}>
|
||||
{icon || <InfoCircleIcon />}
|
||||
<Text strong>{title}</Text>
|
||||
</Flex>
|
||||
{description && <Text>{description}</Text>}
|
||||
<Flex justify={'end'}>
|
||||
<Button type='primary' onClick={onOk} loading={okLoading}>
|
||||
{okText || 'OK'}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
MessageDialogView.propTypes = {
|
||||
icon: PropTypes.node,
|
||||
title: PropTypes.node.isRequired,
|
||||
description: PropTypes.node,
|
||||
onOk: PropTypes.func.isRequired,
|
||||
okText: PropTypes.string,
|
||||
okLoading: PropTypes.bool
|
||||
}
|
||||
|
||||
export default MessageDialogView
|
||||
Loading…
x
Reference in New Issue
Block a user