import React from 'react';
import { Button } from '@/components/ui/button.jsx';
import { MessageCircle } from 'lucide-react';

export default function WhatsAppButton({ 
  message = 'Olá! Gostaria de saber mais sobre automação residencial.', 
  children = 'Falar no WhatsApp',
  variant = 'default',
  size = 'default',
  className = ''
}) {
  const phoneNumber = '5547974050051';
  const encodedMessage = encodeURIComponent(message);
  const whatsappUrl = `https://wa.me/${phoneNumber}?text=${encodedMessage}`;

  return (
    <Button
      asChild
      variant={variant}
      size={size}
      className={className}
    >
      <a 
        href={whatsappUrl} 
        target="_blank" 
        rel="noopener noreferrer"
        className="inline-flex items-center gap-2"
      >
        <MessageCircle className="h-5 w-5" />
        {children}
      </a>
    </Button>
  );
}