From 724693c3fee92be793244fb6bdf9ff3277d15614 Mon Sep 17 00:00:00 2001 From: mshriver Date: Tue, 18 Feb 2025 13:43:28 -0500 Subject: [PATCH] Convert EmptyObject --- frontend/src/components/empty-object.js | 68 ++++++++++++++----------- frontend/src/components/index.js | 1 - frontend/src/result.js | 2 +- frontend/src/run.js | 2 +- 4 files changed, 40 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/empty-object.js b/frontend/src/components/empty-object.js index 59aac041..4313c4a1 100644 --- a/frontend/src/components/empty-object.js +++ b/frontend/src/components/empty-object.js @@ -16,33 +16,41 @@ import { import { NavLink } from 'react-router-dom'; -export class EmptyObject extends React.Component { - static propTypes = { - headingText: PropTypes.string, - bodyText: PropTypes.string, - returnLink: PropTypes.string, - returnLinkText: PropTypes.string - }; - render () { - return ( - - - } /> - - {this.props.headingText ? this.props.headingText : 'This object couldn\'t be found.'} - - - {this.props.bodyText ? this.props.bodyText : 'Either the object doesn\'t exist or the ID is invalid.'} - - - - - - - - - ); - } -} +const EmptyObject = (props) => { + const { + headingText, + bodyText, + returnLink, + returnLinkText + } = props; + + return ( + + + } /> + + {headingText ? headingText : 'This object couldn\'t be found.'} + + + {bodyText ? bodyText : 'Either the object doesn\'t exist or the ID is invalid.'} + + + + + + + + + ); +}; + +EmptyObject.propTypes = { + headingText: PropTypes.string, + bodyText: PropTypes.string, + returnLink: PropTypes.string, + returnLinkText: PropTypes.string +}; + +export default EmptyObject; diff --git a/frontend/src/components/index.js b/frontend/src/components/index.js index a991044f..55036237 100644 --- a/frontend/src/components/index.js +++ b/frontend/src/components/index.js @@ -1,5 +1,4 @@ export { ClassificationDropdown, MultiClassificationDropdown } from './classification-dropdown'; export { ClassifyFailuresTable } from './classify-failures'; export { DownloadButton } from './download-button'; -export { EmptyObject } from './empty-object'; export { IbutsuPage } from './ibutsu-page'; diff --git a/frontend/src/result.js b/frontend/src/result.js index ccfce75e..5eb60788 100644 --- a/frontend/src/result.js +++ b/frontend/src/result.js @@ -10,7 +10,7 @@ import { import { HttpClient } from './services/http'; import { Settings } from './settings'; -import { EmptyObject } from './components'; +import EmptyObject from './components/empty-object'; import ResultView from './components/result'; diff --git a/frontend/src/run.js b/frontend/src/run.js index c6a2cdfe..393e233f 100644 --- a/frontend/src/run.js +++ b/frontend/src/run.js @@ -62,9 +62,9 @@ import { } from './utilities'; import { DownloadButton, - EmptyObject, ClassifyFailuresTable, } from './components'; +import EmptyObject from './components/empty-object'; import { FilterTable } from './components/filtertable'; import ResultView from './components/result'; import TabTitle from './components/tabs';