'use client';

import { usePathname } from 'next/navigation';

export default function WhatsAppFloat() {
  const pathname = usePathname();
  const isSchool = pathname === '/school' || pathname?.startsWith('/school/');

  const number  = isSchool ? '919007976180'  : '919330022177';
  const display = isSchool ? '+91 90079 76180' : '+91 93300 22177';

  return (
    <a
      href={`https://wa.me/${number}`}
      target="_blank"
      rel="noopener noreferrer"
      className="wa-float"
      aria-label="Chat with us on WhatsApp"
    >
      <span className="wa-float-pulse" aria-hidden="true" />
      <span className="wa-float-icon">
        <i className="fab fa-whatsapp" />
      </span>
      <span className="wa-float-label">
        <span className="wa-float-tag">Instant Query</span>
        <span className="wa-float-num">{display}</span>
      </span>
    </a>
  );
}
