"use client";
import type { ReactNode } from "react";
import { ArrowUp, Loader2, Square } from "lucide-react";
import { Button } from "@multica/ui/components/ui/button";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@multica/ui/components/ui/tooltip";
interface SubmitButtonProps {
onClick: () => void;
disabled?: boolean;
loading?: boolean;
running?: boolean;
onStop?: () => void;
/**
* Tooltip shown over the send button when idle. Pass a string or a node
* (e.g. `Send · ⌘↵`). Omit to render no tooltip.
* Callers compose the shortcut hint themselves to keep this component
* free of `@multica/core` (platform-detection) and i18n imports.
*/
tooltip?: ReactNode;
/** Tooltip shown over the stop button while a run is in progress. */
stopTooltip?: ReactNode;
}
function SubmitButton({
onClick,
disabled,
loading,
running,
onStop,
tooltip,
stopTooltip,
}: SubmitButtonProps) {
if (running) {
const stopButton = (
);
if (!stopTooltip) return stopButton;
return (
{stopTooltip}
);
}
const submitButton = (
);
if (!tooltip) return submitButton;
return (
{tooltip}
);
}
export { SubmitButton, type SubmitButtonProps };