-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e690000
commit bbde4cf
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/ErroModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useState } from 'react'; | ||
import Button from '@splunk/react-ui/Button'; | ||
import Modal from '@splunk/react-ui/Modal'; | ||
import Message from '@splunk/react-ui/Message'; | ||
|
||
import {getFormattedMessage} from '../util/messageUtil'; | ||
|
||
function ErrorModal(props) { | ||
|
||
const [open, setOpen] = useState(props.open); | ||
|
||
const handleRequestClose = () => { | ||
setOpen(false); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
onRequestClose={handleRequestClose} | ||
open={open} | ||
style={{ width: '600px' }} | ||
> | ||
<Modal.Header | ||
onRequestClose={handleRequestClose} | ||
title={getFormattedMessage(104)} | ||
/> | ||
<Modal.Body> | ||
<Message appearance="fill" type="error"> | ||
{props.message} | ||
</Message> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button appearance="primary" onClick={handleRequestClose} label="OK" /> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default ErrorModal; |