1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-05-06 09:40:54 +02:00
foris-js/src/common/ActionButtonWithModal/ActionButtonWithModal.md

25 lines
603 B
Markdown

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 (
<AlertContextProvider>
<div id="modal-container" />
<div id="alert-container" />
<RebootButton />
</AlertContextProvider>
);
};
<RebootButtonExample />;
```