revert style: clean up code with prettier and eslint
This commit is contained in:
Remco
2026-07-12 21:02:03 +02:00
parent 27de078f54
commit e85e4d74ea
378 changed files with 20710 additions and 22428 deletions
+19 -19
View File
@@ -1,36 +1,36 @@
"use client";
'use client'
import { DataTable } from "@/components/admin/data-table";
import { formatTimestamp } from "@/lib/admin-helpers";
import type { DataTableColumn, PaginatedResult } from "@/types";
import { DataTable } from '@/components/admin/data-table'
import { formatTimestamp } from '@/lib/admin-helpers'
import type { DataTableColumn, PaginatedResult } from '@/types'
interface ChatLogRow {
id: number;
username: string;
message: string;
timestamp: number;
roomId: number;
id: number
username: string
message: string
timestamp: number
roomId: number
}
const columns: DataTableColumn<ChatLogRow>[] = [
{ key: "id", label: "ID", sortable: true },
{ key: "username", label: "User" },
{ key: 'id', label: 'ID', sortable: true },
{ key: 'username', label: 'User' },
{
key: "message",
label: "Message",
key: 'message',
label: 'Message',
render: (value) => <span className="max-w-[300px] truncate block">{String(value)}</span>,
},
{
key: "timestamp",
label: "Time",
key: 'timestamp',
label: 'Time',
sortable: true,
render: (value) => <span>{formatTimestamp(Number(value))}</span>,
},
{ key: "roomId", label: "Room ID", sortable: true },
];
{ key: 'roomId', label: 'Room ID', sortable: true },
]
interface ChatTableProps {
data: PaginatedResult<ChatLogRow>;
data: PaginatedResult<ChatLogRow>
}
export function ChatTable({ data }: ChatTableProps) {
@@ -41,5 +41,5 @@ export function ChatTable({ data }: ChatTableProps) {
searchPlaceholder="Search by username or message..."
exportUrl="/api/admin/export?type=chatlogs"
/>
);
)
}
+2 -2
View File
@@ -1,4 +1,4 @@
import { Skeleton } from "@/components/ui/skeleton";
import { Skeleton } from '@/components/ui/skeleton'
export default function ChatLogsLoading() {
return (
@@ -24,5 +24,5 @@ export default function ChatLogsLoading() {
))}
</div>
</div>
);
)
}
+9 -9
View File
@@ -1,19 +1,19 @@
import { fetchAdminList } from "@/lib/admin-list";
import { PERMS } from "@/lib/permissions";
import { ChatTable } from "./chat-table";
import { fetchAdminList } from '@/lib/admin-list'
import { PERMS } from '@/lib/permissions'
import { ChatTable } from './chat-table'
export default async function ChatLogsPage({
params: paramsPromise,
searchParams,
}: {
params: Promise<{ locale: string }>;
searchParams: Promise<Record<string, string>>;
params: Promise<{ locale: string }>
searchParams: Promise<Record<string, string>>
}) {
const result = await fetchAdminList(
{
permission: PERMS.LOGS_VIEW,
model: "chatLog",
searchFields: ["message", "user.username"],
model: 'chatLog',
searchFields: ['message', 'user.username'],
defaultPerPage: 50,
include: { user: { select: { username: true } } },
mapRow: (l) => ({
@@ -26,7 +26,7 @@ export default async function ChatLogsPage({
},
paramsPromise,
searchParams,
);
)
return (
<div className="space-y-6">
@@ -45,5 +45,5 @@ export default async function ChatLogsPage({
}}
/>
</div>
);
)
}