import { getApiBaseUrl, getMemberToken } from '../../../_lib/api'; import Link from 'next/link'; interface MemberGroupSummary { id: string; name: string; tenantId: string; scopes: string[]; retentionDays: number; policyVersion: string; consentStatus: 'GRANTED' | 'REVOKED' | 'PENDING'; joinedAt: string; } async function fetchGroup(token: string, id: string): Promise { const res = await fetch(`${getApiBaseUrl()}/my/groups/${id}`, { headers: { Accept: 'application/json', Authorization: `Bearer ${token}` }, cache: 'no-store', }).catch(() => null); if (!res || !res.ok) return null; return (await res.json()) as MemberGroupSummary; } export default async function MyGroupDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const token = await getMemberToken(); if (!token) { return (

Sign in required

Complete onboarding to view group details.

); } const group = await fetchGroup(token, id); if (!group) { return (

Group not found

You aren't a member of this group, or it has been removed.

← Back to your groups
); } return (
← All groups

{group.name}

Status:
{group.consentStatus}
Scopes:
{group.scopes.join(', ')}
Retention:
{group.retentionDays} days
Policy version:
{group.policyVersion}
Joined:
{new Date(group.joinedAt).toLocaleString()}

Use the "Revoke consent" button on{' '} your groups list {' '} to opt out of this group.

); }