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

603 B

RebootButton component is a button that opens a modal dialog to confirm the reboot of the device.

Usage

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 />;