feat(chat): expand empty input actions

This commit is contained in:
2026-06-22 19:14:27 +08:00
parent e68cabdc54
commit cebc8f7443
6 changed files with 157 additions and 7 deletions
+5 -1
View File
@@ -17,15 +17,18 @@ import styles from "./chat-send-button.module.css";
export interface ChatSendButtonProps {
disabled: boolean;
hasContent: boolean;
isExpanded?: boolean;
onClick: () => void;
}
export function ChatSendButton({
disabled,
hasContent,
isExpanded = false,
onClick,
}: ChatSendButtonProps) {
const Icon = hasContent ? ArrowUp : Plus;
const ariaLabel = hasContent ? "Send message" : "Open chat actions";
return (
<button
@@ -33,7 +36,8 @@ export function ChatSendButton({
className={`${styles.button} ${disabled ? "" : styles.buttonActive}`}
disabled={disabled}
onClick={onClick}
aria-label={hasContent ? "Send message" : "Add message content"}
aria-expanded={hasContent ? undefined : isExpanded}
aria-label={ariaLabel}
>
<Icon className={styles.icon} size={24} aria-hidden="true" />
</button>