"use client";
/**
 * ChatSendButton 发送按钮
 *
 * 
 *
 * 视觉：
 *   - 默认：粉色背景 + 渐变边缘
 *   - 聚焦 / 激活：完整 primaryGradient（accent → 透明）
 *
 * 图标：固定显示 <ArrowUp />，按钮只负责发送消息。
 */
import { ArrowUp } from "lucide-react";

import styles from "./chat-send-button.module.css";

export interface ChatSendButtonProps {
  disabled: boolean;
  hasContent: boolean;
  onClick: () => void;
  onPointerDownSend: () => void;
}

export function ChatSendButton({
  disabled,
  hasContent,
  onClick,
  onPointerDownSend,
}: ChatSendButtonProps) {
  return (
    <button
      type="button"
      className={`${styles.button} ${
        hasContent && !disabled ? styles.buttonActive : styles.buttonEmpty
      }`}
      disabled={disabled}
      onPointerDown={(event) => {
        if (event.pointerType === "mouse") return;
        if (disabled) return;
        event.preventDefault();
        if (!hasContent) return;
        onPointerDownSend();
      }}
      onClick={onClick}
      aria-label="Send message"
    >
      <ArrowUp className={styles.icon} size={24} aria-hidden="true" />
    </button>
  );
}
