Skip to content

Commit afa5636

Browse files
committed
Updated the cancel run dialog
1 parent a20136e commit afa5636

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed
Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { StopCircleIcon } from "@heroicons/react/20/solid";
2+
import { NoSymbolIcon } from "@heroicons/react/24/solid";
3+
import { DialogClose } from "@radix-ui/react-dialog";
24
import { Form, useFetcher, useNavigation } from "@remix-run/react";
35
import { Button } from "~/components/primitives/Buttons";
46
import {
@@ -7,6 +9,8 @@ import {
79
DialogFooter,
810
DialogHeader,
911
} from "~/components/primitives/Dialog";
12+
import { FormButtons } from "~/components/primitives/FormButtons";
13+
import { Paragraph } from "~/components/primitives/Paragraph";
1014

1115
type 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

Comments
 (0)