feat(chat): expand empty input actions
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user