Viewing Report
-
-
-
-
- {report.content.report_reason.includes("Illegal") && (
- Urgent
- )}{" "}
- {report.additional_context || "No reason specified"}
-
-
- {report._id.toString().substring(20, 26)} ·{" "}
- {report.content.report_reason} · {report.content.type}
-
-
-
-
-
-
-
-
-
-
-
-
-
- Custom Reason
-
- Presets
- Invalid
- False or Spam
- Duplicate
- Not Enough Evidence
- Request Clarification
- Acknowledge Only
- Ignore
-
-
-
+
+
@@ -132,7 +74,12 @@ export default async function Reports({ params }: { params: { id: string } }) {
Other Reports
{relatedReports[index].map((relatedReport) => (
-
+
+
+
))}
) : undefined}
diff --git a/app/panel/reports/page.tsx b/app/panel/reports/page.tsx
index 2a44b83..8ca5f55 100644
--- a/app/panel/reports/page.tsx
+++ b/app/panel/reports/page.tsx
@@ -1,4 +1,5 @@
import { ReportCard } from "@/components/cards/ReportCard";
+import { CardLink } from "@/components/common/CardLink";
import { Input } from "@/components/ui/input";
import { fetchReports } from "@/lib/db";
@@ -11,7 +12,9 @@ export default async function Reports() {
{reports.map((report) => (
-
+
+
+
))}
);
diff --git a/components/cards/ChannelCard.tsx b/components/cards/ChannelCard.tsx
index af69067..d96d503 100644
--- a/components/cards/ChannelCard.tsx
+++ b/components/cards/ChannelCard.tsx
@@ -1,7 +1,6 @@
import { Channel } from "revolt-api";
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
-import Link from "next/link";
import { AUTUMN_URL } from "@/lib/constants";
export function ChannelCard({
@@ -18,14 +17,12 @@ export function ChannelCard({
channel.channel_type === "DirectMessage" ? "Direct Message" : channel.name;
return (
-
+
{channel.channel_type !== "DirectMessage" && (
-
+
)}
{name
diff --git a/components/cards/JsonCard.tsx b/components/cards/JsonCard.tsx
index c329b39..13079e9 100644
--- a/components/cards/JsonCard.tsx
+++ b/components/cards/JsonCard.tsx
@@ -14,7 +14,7 @@ export function JsonCard({ obj }: { obj: any }) {
const [shown, setShown] = useState(false);
return (
-
+
Document
Raw JSON representation
diff --git a/components/cards/ReportCard.tsx b/components/cards/ReportCard.tsx
index 89b4d68..a14fc52 100644
--- a/components/cards/ReportCard.tsx
+++ b/components/cards/ReportCard.tsx
@@ -1,4 +1,3 @@
-import Link from "next/link";
import { Report } from "revolt-api";
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
import { Badge } from "../ui/badge";
@@ -10,28 +9,26 @@ dayjs.extend(relativeTime);
export function ReportCard({ report }: { report: Report }) {
return (
-
-
-
-
- {report.content.report_reason.includes("Illegal") && (
-
- Urgent
-
- )}{" "}
- {report.additional_context || "No reason specified"}
-
-
- {report._id.toString().substring(20, 26)} ·{" "}
- {report.content.report_reason} · {report.content.type}{" "}
- · {dayjs(decodeTime(report._id)).fromNow()}
-
-
-
-
+
+
+
+ {report.content.report_reason.includes("Illegal") && (
+
+ Urgent
+
+ )}{" "}
+ {report.additional_context || "No reason specified"}
+
+
+ {report._id.toString().substring(20, 26)} ·{" "}
+ {report.content.report_reason} · {report.content.type} ·{" "}
+ {dayjs(decodeTime(report._id)).fromNow()}
+
+
+
);
}
diff --git a/components/cards/ServerCard.tsx b/components/cards/ServerCard.tsx
index 9ce85bd..7e53fb4 100644
--- a/components/cards/ServerCard.tsx
+++ b/components/cards/ServerCard.tsx
@@ -1,7 +1,6 @@
import { Server } from "revolt-api";
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
-import Link from "next/link";
import { AUTUMN_URL } from "@/lib/constants";
export function ServerCard({
@@ -12,13 +11,11 @@ export function ServerCard({
subtitle: string;
}) {
return (
-
+
-
+
{server.name
.split(" ")
diff --git a/components/cards/UserCard.tsx b/components/cards/UserCard.tsx
index d347dea..6154dca 100644
--- a/components/cards/UserCard.tsx
+++ b/components/cards/UserCard.tsx
@@ -7,7 +7,7 @@ import { AUTUMN_URL } from "@/lib/constants";
export function UserCard({ user, subtitle }: { user: User; subtitle: string }) {
return (
-
+
{(user.display_name ?? user.username)
.split(" ")
diff --git a/components/common/CardLink.tsx b/components/common/CardLink.tsx
new file mode 100644
index 0000000..047d3b1
--- /dev/null
+++ b/components/common/CardLink.tsx
@@ -0,0 +1,19 @@
+import Link from "next/link";
+import { ReactNode } from "react";
+
+export function CardLink({
+ href,
+ children,
+}: {
+ href: string;
+ children: ReactNode;
+}) {
+ return (
+
+ {children}
+
+ );
+}
diff --git a/components/inspector/RelevantReports.tsx b/components/inspector/RelevantReports.tsx
index 6691228..b88c302 100644
--- a/components/inspector/RelevantReports.tsx
+++ b/components/inspector/RelevantReports.tsx
@@ -3,6 +3,7 @@
import { Report } from "revolt-api";
import { ListCompactor } from "../common/ListCompactor";
import { ReportCard } from "../cards/ReportCard";
+import { CardLink } from "../common/CardLink";
export function RelevantReports({
byUser,
@@ -17,14 +18,22 @@ export function RelevantReports({
Created Reports
}
+ Component={({ item }) => (
+
+
+
+ )}
/>