diff --git a/src/common/RebootButton.js b/src/common/RebootButton.js index 9b9f85e..380b30d 100644 --- a/src/common/RebootButton.js +++ b/src/common/RebootButton.js @@ -16,6 +16,11 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from "../bootstrap/Modal"; import { useAlert } from "../context/alertContext/AlertContext"; import { ForisURLs } from "../utils/forisUrls"; +RebootButton.propTypes = { + /** Additional props to be passed to the button */ + props: PropTypes.object, +}; + function RebootButton(props) { const [triggered, setTriggered] = useState(false); const [modalShown, setModalShown] = useState(false); @@ -68,7 +73,12 @@ function RebootModal({ shown, setShown, onReboot }) {

{_("Are you sure you want to restart the router?")}

- + diff --git a/src/common/RebootButton.md b/src/common/RebootButton.md new file mode 100644 index 0000000..58a328a --- /dev/null +++ b/src/common/RebootButton.md @@ -0,0 +1,24 @@ +RebootButton component is a button that opens a modal dialog to confirm the +reboot of the device. + +## Usage + +```jsx +import React, { useEffect, createContext } from "react"; +import RebootButton from "./RebootButton"; +import { AlertContextProvider } from "../context/alertContext/AlertContext"; + +window.AlertContext = React.createContext(); + +const RebootButtonExample = () => { + return ( + +