feat(mod): lite /mod panel + clarify ACL vs housekeeping legacy
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
a384c9a8bb
commit
084cca6ea4
18 files changed
+931
-77
No files matched your search
@@ -74,6 +74,8 @@ export function CfhDetail({
|
||||
canEdit,
|
||||
// biome-ignore lint/correctness/noUnusedFunctionParameters: part of the public component API
|
||||
currentUserId,
|
||||
listHref = "/admin/moderation/cfh",
|
||||
userLinkMode = "admin",
|
||||
}: {
|
||||
ticket: {
|
||||
id: number;
|
||||
@@ -91,6 +93,8 @@ export function CfhDetail({
|
||||
banHistory: { count: number; recent: BanRecord[] };
|
||||
canEdit: boolean;
|
||||
currentUserId: number;
|
||||
listHref?: string;
|
||||
userLinkMode?: "admin" | "public";
|
||||
}) {
|
||||
const { run, isPending } = useServerAction();
|
||||
const [alertMsg, setAlertMsg] = useState("");
|
||||
@@ -98,11 +102,18 @@ export function CfhDetail({
|
||||
|
||||
const state = CFH_STATES[ticket.state] ?? CFH_STATES[0];
|
||||
|
||||
function userHref(user: UserInfo) {
|
||||
if (userLinkMode === "public") {
|
||||
return `/u/${encodeURIComponent(user.username)}`;
|
||||
}
|
||||
return `/admin/users/show/${user.id}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Header */}
|
||||
<div className="flex items-start gap-4">
|
||||
<Link href="/admin/moderation/cfh">
|
||||
<Link href={listHref}>
|
||||
<Button variant="ghost" size="icon">
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
</Button>
|
||||
@@ -155,7 +166,7 @@ export function CfhDetail({
|
||||
<CardContent>
|
||||
{sender ? (
|
||||
<Link
|
||||
href={`/admin/users/show/${sender.id}`}
|
||||
href={userHref(sender)}
|
||||
className="flex items-center gap-3 hover:text-primary no-underline"
|
||||
>
|
||||
<User className="h-4 w-4" />
|
||||
@@ -184,7 +195,7 @@ export function CfhDetail({
|
||||
{reported ? (
|
||||
<div>
|
||||
<Link
|
||||
href={`/admin/users/show/${reported.id}`}
|
||||
href={userHref(reported)}
|
||||
className="flex items-center gap-3 hover:text-primary no-underline"
|
||||
>
|
||||
<AlertTriangle className="h-4 w-4 text-[var(--admin-error)]" />
|
||||
@@ -400,7 +411,7 @@ export function CfhDetail({
|
||||
<CardContent>
|
||||
{moderator ? (
|
||||
<Link
|
||||
href={`/admin/users/show/${moderator.id}`}
|
||||
href={userHref(moderator)}
|
||||
className="flex items-center gap-2 text-sm hover:text-primary no-underline"
|
||||
>
|
||||
<Shield className="h-3.5 w-3.5 text-primary" />
|
||||
|
||||
Reference in new issue
Block a user