Barazo default frontend
barazo.forum
1/**
2 * ModerationReportedUsersTab - Users sorted by report count.
3 * @see specs/prd-web.md Section M11
4 */
5
6import { Prohibit } from '@phosphor-icons/react'
7import { formatDate } from '@/lib/format'
8import type { ReportedUser } from '@/lib/api/types'
9
10interface ModerationReportedUsersTabProps {
11 users: ReportedUser[]
12}
13
14export function ModerationReportedUsersTab({ users }: ModerationReportedUsersTabProps) {
15 return (
16 <div className="space-y-2">
17 {users.map((user) => (
18 <div key={user.did} className="rounded-md border border-border bg-card p-3">
19 <div className="flex items-center justify-between">
20 <div>
21 <p className="text-sm font-medium text-foreground">{user.handle}</p>
22 <p className="text-xs text-muted-foreground">
23 {user.reportCount} reports · Latest: {formatDate(user.latestReportAt)}
24 </p>
25 {user.bannedFromOtherCommunities > 0 && (
26 <p className="mt-1 inline-flex items-center gap-1 text-xs font-medium text-destructive">
27 <Prohibit size={12} aria-hidden="true" />
28 Banned from {user.bannedFromOtherCommunities} other communities
29 </p>
30 )}
31 </div>
32 </div>
33 </div>
34 ))}
35 {users.length === 0 && (
36 <p className="py-8 text-center text-muted-foreground">No reported users.</p>
37 )}
38 </div>
39 )
40}