import { useMemo } from 'react'; import { EmptyState, SearchInput } from '@/components'; import { LogsDataGrid, type LogsColumnDef } from '../components/LogsDataGrid'; import { useMcpUsage } from '../hooks/useMcpUsage'; import { formatTime } from '@/lib/utils/utils'; import { LOGS_PAGE_SIZE } from '../helpers'; export default function MCPLogsPage() { const { records: mcpLogs, filteredRecords: filteredMcpRecords, searchQuery: mcpSearchQuery, setSearchQuery: setMcpSearchQuery, currentPage: mcpCurrentPage, setCurrentPage: setMcpCurrentPage, totalPages: mcpTotalPages, isLoading: mcpLoading, error: mcpError, } = useMcpUsage(); const mcpColumns: LogsColumnDef[] = useMemo( () => [ { key: 'tool_name', name: 'MCP Call', width: '12fr', }, { key: 'created_at', name: 'Time', width: 'minmax(200px, 1fr)', renderCell: ({ row }) => (
{formatTime(String(row.created_at ?? ''))}
), }, ], [] ); return (MCP