"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/common"; interface CommandLogRow { id: number; username: string; command: string; params: string; timestamp: number; } interface CommandsTableProps { data: PaginatedResult; } export function CommandsTable({ data }: CommandsTableProps) { const t = useTranslations("pages.admin.logs"); const columns: DataTableColumn[] = [ { key: "id", label: t("colId"), sortable: true }, { key: "username", label: t("colUser") }, { key: "command", label: t("commands.colCommand"), sortable: true }, { key: "params", label: t("commands.colParams"), render: (value) => ( {String(value) || t("emptyValue")} ), }, { key: "timestamp", label: t("colTime"), sortable: true, render: (value) => ( {formatDate(new Date(Number(value) * 1000))} ), }, ]; return ( ); }