"use client";
import React, { Suspense, useEffect, useMemo, useState } from "react";
import { useAuth } from "@/hooks/useAuth";
import { useRouter, useSearchParams } from "next/navigation";
import { apiFetch, fetchAllUsers } from "@/lib/api";
import { useDismissingState } from "@/hooks/useDismissingState";
import { MessageCircle } from "lucide-react";
// Attendee with preference info
type Attendee = { id: string; name: string; phone: string; pref: string };
type UserEntry = { id: string; name: string; phone: string; pref: string };
function toLocalInputValue(d: Date) {
const pad = (n: number) => String(n).padStart(2, "0");
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
}
export default function WhatsAppAttendeesPage() {
return (
Personalize your message per recipient using these placeholders.
{"{{name}}"} — attendee's name.{"{{event.title}}"} — the event title.{"{{event.start}}"} — the event start date/time.{"{{balance}}"} — outstanding balance for the event.{"{{payment.link}}"} — a direct Yoco payment link for the attendee's outstanding balance (generated per recipient when sending).Preference indicators: WA = WhatsApp only,{" "} both = WhatsApp + Email,{" "} email = Email only (will still receive message).