forked from administration/panel
feat: show username of grouped reports rather than id
parent
cdb05a5af7
commit
e9b623f60d
|
@ -1,7 +1,7 @@
|
|||
import { ReportCard } from "@/components/cards/ReportCard";
|
||||
import { CardLink } from "@/components/common/CardLink";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { fetchOpenReports } from "@/lib/db";
|
||||
import { fetchOpenReports, fetchUsersById } from "@/lib/db";
|
||||
import { PizzaIcon } from "lucide-react";
|
||||
import { Report } from "revolt-api";
|
||||
|
||||
|
@ -41,6 +41,11 @@ export default async function Reports() {
|
|||
}
|
||||
}
|
||||
|
||||
const authorNames: Record<string, string> = {};
|
||||
for (const user of await fetchUsersById(Object.keys(countsByAuthor))) {
|
||||
authorNames[user._id] = user.username + "#" + user.discriminator;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-8">
|
||||
{/*<Input placeholder="Search for reports..." disabled />*/}
|
||||
|
@ -48,7 +53,7 @@ export default async function Reports() {
|
|||
keyOrder.map((key) => {
|
||||
return (
|
||||
<div key={key} className="flex flex-col gap-2">
|
||||
<h1 className="text-2xl">{key}</h1>
|
||||
<h1 className="text-2xl">{authorNames[key] ?? key}</h1>
|
||||
{byCategory[key].map((report) => (
|
||||
<CardLink
|
||||
key={report._id}
|
||||
|
|
Loading…
Reference in New Issue