feat(web): close #358 invites RowActionsMenu wiring

The mobile-responsive design called for all 4 admin tables to use
RowActionsMenu. Requests + Quarantine + Users users-section landed
in earlier commits; the invites section in the same users page was
still rendering inline Copy/Revoke buttons. Now uses RowActionsMenu
with primary Copy + secondary Revoke (danger).

Extend expiry from the design's secondary list deferred — no
server endpoint exists yet (lib/api/admin.ts has no
extendInviteExpiry).

Closes the in-code portion of #358. Real-device verification
walkthrough at 375/414/768 + grid/safe-area checks remain
operator-side.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 17:14:18 -04:00
parent 308202a1df
commit 1daf0b7fdf
+19 -18
View File
@@ -20,7 +20,7 @@
import { pushToast } from '$lib/stores/toast.svelte';
import Modal from '$lib/components/Modal.svelte';
import RowActionsMenu, { type RowAction } from '$lib/components/RowActionsMenu.svelte';
import { Shield, ShieldOff, CheckCircle2, XCircle, KeyRound, Trash2 } from 'lucide-svelte';
import { Shield, ShieldOff, CheckCircle2, XCircle, KeyRound, Trash2, Copy } from 'lucide-svelte';
const client = useQueryClient();
@@ -329,23 +329,24 @@
<span class="shrink-0 text-xs text-text-secondary">
expires {formatDate(inv.expires_at)}
</span>
<button
type="button"
aria-label={`Copy token for invite ${inv.token}`}
class="inline-flex items-center gap-1 rounded-md border border-border bg-transparent px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-hover hover:text-text-primary"
onclick={() => copyToken(inv.token)}
>
Copy
</button>
<button
type="button"
disabled={saving}
aria-label={`Revoke invite ${inv.token}`}
class="inline-flex items-center gap-1 rounded-md border border-border bg-transparent px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-hover hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-50"
onclick={() => onRevokeInvite(inv)}
>
Revoke
</button>
<RowActionsMenu
primary={{
icon: Copy,
label: 'Copy',
ariaLabel: `Copy token for invite ${inv.token}`,
onclick: () => copyToken(inv.token)
}}
secondary={[
{
icon: Trash2,
label: 'Revoke',
ariaLabel: `Revoke invite ${inv.token}`,
onclick: () => onRevokeInvite(inv),
danger: true,
disabled: saving
}
]}
/>
</li>
{/each}
</ul>