import type React from "react"; import { useState } from "react"; import { useDevice } from "@app/core/providers/useDevice.js"; import { Dialog } from "@components/generic/Dialog.js"; import { ClockIcon, PowerIcon } from "@heroicons/react/24/outline"; import { Button } from "../form/Button.js"; import { Input } from "../form/Input.js"; export interface ShutdownDialogProps { isOpen: boolean; close: () => void; } export const ShutdownDialog = ({ isOpen, close }: ShutdownDialogProps): JSX.Element => { const { connection, setShutdownDialogOpen } = useDevice(); const [time, setTime] = useState(5); return (
setTime(parseInt(e.target.value))} action={{ icon: , action() { connection ?.shutdown(time * 60) .then(() => setShutdownDialogOpen(false)); } }} />
); };