Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,80 @@ function ContactChannelsSection({ user }: ContactChannelsSectionProps) {
);
}

type UserTeamsSectionProps = {
user: ServerUser,
};

function UserTeamsSection({ user }: UserTeamsSectionProps) {
const stackAdminApp = useAdminApp();
const teams = user.useTeams();

return (
<div className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h2 className="text-lg font-semibold">Teams</h2>
<p className="text-sm text-muted-foreground">Teams this user belongs to</p>
</div>
</div>

{teams.length === 0 ? (
<div className="flex flex-col items-center gap-2 p-4 border rounded-md bg-muted/10">
<p className='text-sm text-gray-500 text-center'>
No teams found
</p>
</div>
) : (
<div className='border rounded-md'>
<Table>
<TableHeader>
<TableRow>
<TableHead>Team ID</TableHead>
<TableHead>Display Name</TableHead>
<TableHead>Created At</TableHead>
<TableHead className="w-[80px]"></TableHead>
</TableRow>
</TableHeader>
<TableBody>
{teams.map((team) => (
<TableRow key={team.id}>
<TableCell>
<div className="font-mono text-xs bg-muted px-2 py-1 rounded max-w-[120px] truncate">
{team.id}
</div>
</TableCell>
<TableCell>
<div className="font-medium">
{team.displayName || '-'}
</div>
</TableCell>
<TableCell>
<div className="text-sm text-muted-foreground">
{team.createdAt.toLocaleDateString()}
</div>
</TableCell>
<TableCell align="right">
<ActionCell
items={[
{
item: "View Team",
onClick: () => {
window.open(`/projects/${stackAdminApp.projectId}/teams/${team.id}`, '_blank', 'noopener');
Comment thread
madster456 marked this conversation as resolved.
},
},
]}
/>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
)}
</div>
);
}

type OAuthProvidersSectionProps = {
user: ServerUser,
};
Expand Down Expand Up @@ -1230,8 +1304,8 @@ function UserPage({ user }: { user: ServerUser }) {
<UserDetails user={user} />
<Separator />
<ContactChannelsSection user={user} />
<UserTeamsSection user={user} />
<OAuthProvidersSection user={user} />
<div />
<MetadataSection user={user} />
</div>
</PageLayout>
Expand Down