({error, panelId, panelDocker})
| 16 | })); |
| 17 | |
| 18 | export default function ToolErrorView({error, panelId, panelDocker}){ |
| 19 | const { deleteToolData } = useApplicationState(); |
| 20 | panelDocker.eventBus.registerListener(LAYOUT_EVENTS.CLOSING, (id)=>{ |
| 21 | if(panelId == id) { |
| 22 | panelDocker.close(panelId, true); |
| 23 | deleteToolData(panelId); |
| 24 | } |
| 25 | }); |
| 26 | |
| 27 | let err_msg = gettext('An error occurred while opening the tool: %s', error ?? ''); |
| 28 | return (<StyledBox> |
| 29 | <FormHelperText variant="outlined" error={true} style={{marginLeft: '4px'}}><SafeMessage text={err_msg} /></FormHelperText> |
| 30 | </StyledBox>); |
| 31 | } |
| 32 | |
| 33 | ToolErrorView.propTypes = { |
| 34 | error: PropTypes.string, |
nothing calls this directly
no test coverage detected