@@ -2,7 +2,7 @@ import { useNavigate } from "react-router-dom";
2
2
import { useCallback } from "react" ;
3
3
4
4
import { useJsonRpc } from "@/hooks/useJsonRpc" ;
5
- import { Button } from "@components/Button " ;
5
+ import { ConfirmDialog } from "@/ components/ConfirmDialog " ;
6
6
7
7
export default function SettingsGeneralRebootRoute ( ) {
8
8
const navigate = useNavigate ( ) ;
@@ -16,51 +16,14 @@ export default function SettingsGeneralRebootRoute() {
16
16
{
17
17
/* TODO: Migrate to using URLs instead of the global state. To simplify the refactoring, we'll keep the global state for now. */
18
18
}
19
- return < Dialog onClose = { ( ) => navigate ( ".." ) } onConfirmUpdate = { onConfirmUpdate } /> ;
20
- }
21
-
22
- export function Dialog ( {
23
- onClose,
24
- onConfirmUpdate,
25
- } : {
26
- onClose : ( ) => void ;
27
- onConfirmUpdate : ( ) => void ;
28
- } ) {
29
-
30
- return (
31
- < div className = "pointer-events-auto relative mx-auto text-left" >
32
- < div >
33
- < ConfirmationBox
34
- onYes = { onConfirmUpdate }
35
- onNo = { onClose }
36
- />
37
- </ div >
38
- </ div >
39
- ) ;
40
- }
41
-
42
- function ConfirmationBox ( {
43
- onYes,
44
- onNo,
45
- } : {
46
- onYes : ( ) => void ;
47
- onNo : ( ) => void ;
48
- } ) {
49
19
return (
50
- < div className = "flex flex-col items-start justify-start space-y-4 text-left" >
51
- < div className = "text-left" >
52
- < p className = "text-base font-semibold text-black dark:text-white" >
53
- Reboot JetKVM
54
- </ p >
55
- < p className = "text-sm text-slate-600 dark:text-slate-300" >
56
- Do you want to proceed with rebooting the system?
57
- </ p >
58
-
59
- < div className = "mt-4 flex gap-x-2" >
60
- < Button size = "SM" theme = "light" text = "Yes" onClick = { onYes } />
61
- < Button size = "SM" theme = "blank" text = "No" onClick = { onNo } />
62
- </ div >
63
- </ div >
64
- </ div >
20
+ < ConfirmDialog
21
+ open = { true }
22
+ onClose = { ( ) => navigate ( ".." ) }
23
+ title = "Reboot JetKVM"
24
+ description = "Do you want to proceed with rebooting the JetKVM?"
25
+ variant = "danger"
26
+ onConfirm = { onConfirmUpdate }
27
+ />
65
28
) ;
66
- }
29
+ }
0 commit comments