Файли
openidea/src/features/agents/SubmitButton.tsx
T
l0ng-ai 2841f97145 fix(agents): use icon-only composer actions (#613)
The composers' primary actions were text buttons. Start, Send and Queue, plus Send in edit-and-resend, now share an icon-only submit button that keeps the translated name as its accessible label and tooltip, and shows a spinner while the action is pending. Stop is unchanged.
2026-11-01 04:18:32 +08:00

29 рядки
722 B
TypeScript

import { useTx } from "@/platform/i18n";
import { Button, Icon, Spinner, tooltipAttrs, type ButtonProps } from "@/ui";
import styles from "./SubmitButton.module.css";
export function SubmitButton({
label,
pending = false,
variant = "primary",
...props
}: Pick<ButtonProps, "disabled" | "onClick" | "variant"> & {
label: "Start" | "Starting…" | "Send" | "Queue";
pending?: boolean;
}) {
const tx = useTx();
const name = tx(label);
return (
<Button
{...props}
variant={variant}
size="small"
className={styles.submit}
aria-label={name}
{...tooltipAttrs(name)}
>
{pending ? <Spinner size={12} /> : <Icon name="arrow-up" size={14} />}
</Button>
);
}