import { Button } from "@components/UI/Button.js"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@components/UI/Dialog.js"; import { Input } from "@components/UI/Input.js"; import { useDevice } from "@core/stores/deviceStore.js"; import { ClockIcon, RefreshCwIcon } from "lucide-react"; import { useState } from "react"; export interface RebootDialogProps { open: boolean; onOpenChange: (open: boolean) => void; } export const RebootDialog = ({ open, onOpenChange, }: RebootDialogProps): JSX.Element => { const { connection } = useDevice(); const [time, setTime] = useState(5); return ( Schedule Reboot Reboot the connected node after x minutes.
setTime(parseInt(e.target.value))} action={{ icon: ClockIcon, onClick() { connection?.reboot(time * 60).then(() => onOpenChange(false)); }, }} />
); };