| 1 | import type { ServerProcessSignal } from "@t3tools/contracts"; |
| 2 | |
| 3 | import { InlineButton } from "../ui/button"; |
| 4 | import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; |
| 5 | |
| 6 | /** Process ownership and confirmation stay with the diagnostics view. */ |
| 7 | export function ProcessSignalActions({ |
| 8 | disabled, |
| 9 | onSignal, |
| 10 | }: { |
| 11 | disabled: boolean; |
| 12 | onSignal: (signal: ServerProcessSignal) => void; |
| 13 | }) { |
| 14 | return ( |
| 15 | <div className="flex items-center justify-end gap-1.5"> |
| 16 | <Tooltip> |
| 17 | <TooltipTrigger |
| 18 | render={ |
| 19 | <InlineButton |
| 20 | disabled={disabled} |
| 21 | aria-label="Send SIGINT" |
| 22 | tone="muted" |
| 23 | onClick={() => onSignal("SIGINT")} |
| 24 | > |
| 25 | INT |
| 26 | </InlineButton> |
| 27 | } |
| 28 | /> |
| 29 | <TooltipPopup side="top">Send SIGINT</TooltipPopup> |
| 30 | </Tooltip> |
| 31 | <Tooltip> |
| 32 | <TooltipTrigger |
| 33 | render={ |
| 34 | <InlineButton |
| 35 | disabled={disabled} |
| 36 | aria-label="Send SIGKILL" |
| 37 | tone="destructive" |
| 38 | onClick={() => onSignal("SIGKILL")} |
| 39 | > |
| 40 | KILL |
| 41 | </InlineButton> |
| 42 | } |
| 43 | /> |
| 44 | <TooltipPopup side="top">Send SIGKILL</TooltipPopup> |
| 45 | </Tooltip> |
| 46 | </div> |
| 47 | ); |
| 48 | } |