49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import type { ServerProcessSignal } from "@t3tools/contracts";
|
|
|
|
import { InlineButton } from "../ui/button";
|
|
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
|
|
|
|
/** Process ownership and confirmation stay with the diagnostics view. */
|
|
export function ProcessSignalActions({
|
|
disabled,
|
|
onSignal,
|
|
}: {
|
|
disabled: boolean;
|
|
onSignal: (signal: ServerProcessSignal) => void;
|
|
}) {
|
|
return (
|
|
<div className="flex items-center justify-end gap-1.5">
|
|
<Tooltip>
|
|
<TooltipTrigger
|
|
render={
|
|
<InlineButton
|
|
disabled={disabled}
|
|
aria-label="Send SIGINT"
|
|
tone="muted"
|
|
onClick={() => onSignal("SIGINT")}
|
|
>
|
|
INT
|
|
</InlineButton>
|
|
}
|
|
/>
|
|
<TooltipPopup side="top">Send SIGINT</TooltipPopup>
|
|
</Tooltip>
|
|
<Tooltip>
|
|
<TooltipTrigger
|
|
render={
|
|
<InlineButton
|
|
disabled={disabled}
|
|
aria-label="Send SIGKILL"
|
|
tone="destructive"
|
|
onClick={() => onSignal("SIGKILL")}
|
|
>
|
|
KILL
|
|
</InlineButton>
|
|
}
|
|
/>
|
|
<TooltipPopup side="top">Send SIGKILL</TooltipPopup>
|
|
</Tooltip>
|
|
</div>
|
|
);
|
|
}
|