This commit is contained in:
1 parent
8efd032cc6
commit
df38dccbf1
735 files changed
+128321
-120870
No files matched your search
@@ -5,41 +5,43 @@ 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: "message",
|
||||
label: "Message",
|
||||
render: (value) => <span className="max-w-[300px] truncate block">{String(value)}</span>,
|
||||
},
|
||||
{
|
||||
key: "timestamp",
|
||||
label: "Time",
|
||||
sortable: true,
|
||||
render: (value) => <span>{formatTimestamp(Number(value))}</span>,
|
||||
},
|
||||
{ key: "roomId", label: "Room ID", sortable: true },
|
||||
{ key: "id", label: "ID", sortable: true },
|
||||
{ key: "username", label: "User" },
|
||||
{
|
||||
key: "message",
|
||||
label: "Message",
|
||||
render: (value) => (
|
||||
<span className="max-w-[300px] truncate block">{String(value)}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "timestamp",
|
||||
label: "Time",
|
||||
sortable: true,
|
||||
render: (value) => <span>{formatTimestamp(Number(value))}</span>,
|
||||
},
|
||||
{ key: "roomId", label: "Room ID", sortable: true },
|
||||
];
|
||||
|
||||
interface ChatTableProps {
|
||||
data: PaginatedResult<ChatLogRow>;
|
||||
data: PaginatedResult<ChatLogRow>;
|
||||
}
|
||||
|
||||
export function ChatTable({ data }: ChatTableProps) {
|
||||
return (
|
||||
<DataTable
|
||||
data={data}
|
||||
columns={columns}
|
||||
searchPlaceholder="Search by username or message..."
|
||||
exportUrl="/api/admin/export?type=chatlogs"
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<DataTable
|
||||
data={data}
|
||||
columns={columns}
|
||||
searchPlaceholder="Search by username or message..."
|
||||
exportUrl="/api/admin/export?type=chatlogs"
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user