11import { StopCircleIcon } from "@heroicons/react/20/solid" ;
2+ import { NoSymbolIcon } from "@heroicons/react/24/solid" ;
3+ import { DialogClose } from "@radix-ui/react-dialog" ;
24import { Form , useFetcher , useNavigation } from "@remix-run/react" ;
35import { Button } from "~/components/primitives/Buttons" ;
46import {
79 DialogFooter ,
810 DialogHeader ,
911} from "~/components/primitives/Dialog" ;
12+ import { FormButtons } from "~/components/primitives/FormButtons" ;
13+ import { Paragraph } from "~/components/primitives/Paragraph" ;
1014
1115type CancelRunDialogProps = {
1216 runFriendlyId : string ;
@@ -22,24 +26,35 @@ export function CancelRunDialog({ runFriendlyId, redirectPath }: CancelRunDialog
2226 return (
2327 < DialogContent key = "cancel" >
2428 < DialogHeader > Cancel this run?</ DialogHeader >
25- < DialogDescription >
26- Canceling a run will stop execution, along with any executing subtasks.
27- </ DialogDescription >
28- < DialogFooter >
29- < Form action = { `/resources/taskruns/${ runFriendlyId } /cancel` } method = "post" >
30- < Button
31- type = "submit"
32- name = "redirectUrl"
33- value = { redirectPath }
34- variant = "danger/small"
35- LeadingIcon = { isLoading ? "spinner-white" : StopCircleIcon }
36- disabled = { isLoading }
37- shortcut = { { modifiers : [ "meta" ] , key : "enter" } }
38- >
39- { isLoading ? "Canceling..." : "Cancel run" }
40- </ Button >
41- </ Form >
42- </ DialogFooter >
29+ < div className = "flex flex-col gap-3 pt-3" >
30+ < Paragraph >
31+ Canceling a run will stop execution, along with any executing subtasks.
32+ </ Paragraph >
33+ < DialogFooter className = "sm:justify-end" >
34+ < FormButtons
35+ confirmButton = {
36+ < Form action = { `/resources/taskruns/${ runFriendlyId } /cancel` } method = "post" >
37+ < Button
38+ type = "submit"
39+ name = "redirectUrl"
40+ value = { redirectPath }
41+ variant = "danger/medium"
42+ LeadingIcon = { isLoading ? "spinner-white" : NoSymbolIcon }
43+ disabled = { isLoading }
44+ shortcut = { { modifiers : [ "meta" ] , key : "enter" } }
45+ >
46+ { isLoading ? "Canceling..." : "Cancel run" }
47+ </ Button >
48+ </ Form >
49+ }
50+ cancelButton = {
51+ < DialogClose asChild >
52+ < Button variant = { "tertiary/medium" } > Close</ Button >
53+ </ DialogClose >
54+ }
55+ />
56+ </ DialogFooter >
57+ </ div >
4358 </ DialogContent >
4459 ) ;
4560}
0 commit comments