/** * ActiveUsersTable — admin-facing customer outreach view. * * Each row is a user active in the selected window: * user_id_hash · top_topic · interest_score · last_activity · contact-ready badge * * Clicking "Inspect" sets the user as the inspected user on the page, jumping * to their cognitive-facet cards above. */ export default function ActiveUsersTable({ rows, onInspect, windowLabel = "", activeHash = "" }) { if (!rows || rows.length === 0) { return (
| User | Top topic | Interest | Turns | Topics | Pos / total rewards | Last seen | Status | |
|---|---|---|---|---|---|---|---|---|
|
{u.display_name || shortHash(u.user_id_hash)}
{shortHash(u.user_id_hash)}
{u.intents?.length > 0 && (
{u.intents.slice(0, 3).map((i) => (
{i}
))}
)}
|
{u.top_topic || "—"} {u.topics?.length > 1 && ( +{u.topics.length - 1} more )} | {fmt(u.top_interest_score)} | {u.turn_count} | {u.topic_count} | {u.positive_rewards} / {u.applied_rewards} | {relativeTime(u.last_activity_ts)} |
{u.do_not_contact ? (
⊘ Do not contact
) : !u.compliance_eligible ? (
⊘ Compliance block
) : u.contact_ready ? (
● Contact ready
) : (
○ Below threshold
)}
{u.recommendation_reason && (
{u.recommendation_reason}
)}
|