'use client';

import { useRouter } from 'next/navigation';

export function LogoutButton() {
  const router = useRouter();

  const handleLogout = async () => {
    await fetch('/api/consumer/logout', { method: 'POST' });
    router.refresh();
  };

  return (
    <button
      type="button"
      onClick={handleLogout}
      className="text-xs text-tertiary hover:text-primary transition-colors"
    >
      Sign out
    </button>
  );
}
