дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
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.
29 рядки
722 B
TypeScript
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>
|
|
);
|
|
}
|