"use client"; import { useTranslations } from "next-intl"; import { DataTable } from "@/components/admin/data-table"; import { formatDate } from "@/lib/format-date"; import type { DataTableColumn, PaginatedResult } from "@/types"; interface ChatLogRow { id: number; username: string; message: string; timestamp: number; roomId: number; } interface ChatTableProps { data: PaginatedResult; } export function ChatTable({ data }: ChatTableProps) { const t = useTranslations("pages.admin.logs"); const columns: DataTableColumn[] = [ { key: "id", label: t("colId"), sortable: true }, { key: "username", label: t("colUser") }, { key: "message", label: t("chat.colMessage"), render: (value) => ( {String(value)} ), }, { key: "timestamp", label: t("colTime"), sortable: true, render: (value) => {formatDate(new Date(Number(value) * 1000))}, }, { key: "roomId", label: t("chat.colRoomId"), sortable: true }, ]; return ( ); }