import React from 'react';
import { Pressable, Text, type ViewStyle } from 'react-native';

interface PrimaryButtonProps {
  title: string;
  onPress?: () => void;
  className?: string;
  style?: ViewStyle;
}

/**
 * 主操作按钮 — 保持纯色和边界清晰，避免过强立体感。
 */
export function PrimaryButton({ title, onPress, className = '' }: PrimaryButtonProps) {
  return (
    <Pressable
      onPress={onPress}
      className={`w-full py-4 bg-primary rounded-lg items-center justify-center ${className}`}
      style={({ pressed }) => ({ opacity: pressed ? 0.92 : 1, transform: [{ scale: pressed ? 0.98 : 1 }] })}
    >
      <Text className="text-on-primary font-bold text-base">{title}</Text>
    </Pressable>
  );
}
