fix(claude-code): paginate the skills table instead of unbounded scroll

Migrated PluginTable off the ad-hoc Tremor+@tanstack/react-table setup
onto the dashboard's shared DataTable (already used elsewhere, e.g.
TeamVirtualKeysTable), which has pagination built in. 25 rows per page
instead of rendering every skill inline.

A bounded-height scroll box was tried first but produced two nested
scrollbars (the box plus the outer page) - removed, since pagination
alone already caps row count and a single page-level scrollbar is
consistent with how the rest of the dashboard behaves.
This commit is contained in:
Krrish Dholakia 2026-07-11 14:03:11 -07:00
parent 62547d67f0
commit bbc6f0b0e0
2 changed files with 439 additions and 521 deletions

View file

@ -12,6 +12,67 @@
"count": 1
}
},
"src/app/(dashboard)/agents/_components/AgentsPanel.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/add_agent_form.tsx": {
"no-nested-ternary": {
"count": 3
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 2
},
"unused-imports/no-unused-imports": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_card_discovery.tsx": {
"react-hooks/refs": {
"count": 3
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_cost_view.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_form_fields.tsx": {
"no-nested-ternary": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_info.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_virtual_keys.tsx": {
"no-nested-ternary": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/dynamic_agent_form_fields.tsx": {
"no-nested-ternary": {
"count": 2
}
},
"src/app/(dashboard)/api-reference/_components/APIReferenceView.tsx": {
"no-restricted-imports": {
"count": 1
@ -164,6 +225,139 @@
"count": 8
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailTestPanel.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailTestPlayground.tsx": {
"no-nested-ternary": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailTestResults.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailsPanel.tsx": {
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/TeamGuardrailsTab.tsx": {
"no-nested-ternary": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/add_guardrail_form.tsx": {
"no-nested-ternary": {
"count": 4
},
"react-hooks/set-state-in-effect": {
"count": 1
},
"react/no-unescaped-entities": {
"count": 2
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/CompetitorIntentConfiguration.tsx": {
"no-nested-ternary": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/ContentCategoryConfiguration.tsx": {
"no-nested-ternary": {
"count": 3
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/ContentFilterDisplay.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/ContentFilterManager.tsx": {
"max-params": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/custom_code/CustomCodeModal.tsx": {
"no-nested-ternary": {
"count": 6
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/edit_guardrail_form.tsx": {
"no-restricted-imports": {
"count": 1
},
"no-restricted-syntax": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_info.tsx": {
"max-params": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 3
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_optional_params.tsx": {
"no-nested-ternary": {
"count": 5
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_provider_fields.tsx": {
"no-nested-ternary": {
"count": 5
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_table.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/tool_permission/ToolPermissionRulesEditor.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/purity": {
"count": 1
}
},
"src/app/(dashboard)/hooks/accessGroups/useAccessGroupDetails.ts": {
"no-restricted-syntax": {
"count": 1
@ -536,6 +730,134 @@
"count": 1
}
},
"src/app/(dashboard)/policies/_components/add_attachment_form.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/add_policy_form.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/ai_suggestion_modal.tsx": {
"no-nested-ternary": {
"count": 10
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/attachment_table.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/attachment_table.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/guardrail_selection_modal.tsx": {
"no-nested-ternary": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/impact_popover.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/impact_popover.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/index.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/pipeline_flow_builder.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 2
}
},
"src/app/(dashboard)/policies/_components/policy_info.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_table.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_table.tsx": {
"no-nested-ternary": {
"count": 2
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_test_panel.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/template_parameter_modal.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/projects/_components/ProjectDetailsPage.tsx": {
"no-nested-ternary": {
"count": 3
@ -697,6 +1019,50 @@
"count": 1
}
},
"src/app/(dashboard)/skills/_components/ClaudeCodePluginsPanel.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/skills/_components/add_plugin_form.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/skills/_components/plugin_table.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/TagTable.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/components/CreateTagModal.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/tag_info.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/transform-request/TransformRequestPanel.tsx": {
"no-restricted-imports": {
"count": 1
@ -774,6 +1140,43 @@
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/CreateVectorStore.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx": {
"no-nested-ternary": {
"count": 2
},
"no-restricted-imports": {
"count": 1
},
"react/no-unescaped-entities": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/VectorStoreTable.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/vector_store_info.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/workflows/WorkflowRuns.tsx": {
"no-nested-ternary": {
"count": 1
@ -1261,67 +1664,6 @@
"count": 1
}
},
"src/app/(dashboard)/agents/_components/AgentsPanel.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/add_agent_form.tsx": {
"no-nested-ternary": {
"count": 3
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 2
},
"unused-imports/no-unused-imports": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_card_discovery.tsx": {
"react-hooks/refs": {
"count": 3
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_cost_view.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_form_fields.tsx": {
"no-nested-ternary": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_info.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/agent_virtual_keys.tsx": {
"no-nested-ternary": {
"count": 1
}
},
"src/app/(dashboard)/agents/_components/dynamic_agent_form_fields.tsx": {
"no-nested-ternary": {
"count": 2
}
},
"src/components/alerting/dynamic_form.tsx": {
"no-nested-ternary": {
"count": 4
@ -1363,14 +1705,6 @@
"count": 2
}
},
"src/app/(dashboard)/skills/_components/ClaudeCodePluginsPanel.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/components/claude_code_plugins/MakeSkillPublicForm.tsx": {
"no-restricted-imports": {
"count": 1
@ -1379,19 +1713,6 @@
"count": 1
}
},
"src/app/(dashboard)/skills/_components/add_plugin_form.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/skills/_components/plugin_table.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/components/cloudzero_export_modal.tsx": {
"no-restricted-imports": {
"count": 1
@ -1534,139 +1855,6 @@
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailsPanel.tsx": {
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailTestPanel.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailTestPlayground.tsx": {
"no-nested-ternary": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/GuardrailTestResults.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/TeamGuardrailsTab.tsx": {
"no-nested-ternary": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/add_guardrail_form.tsx": {
"no-nested-ternary": {
"count": 4
},
"react-hooks/set-state-in-effect": {
"count": 1
},
"react/no-unescaped-entities": {
"count": 2
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/CompetitorIntentConfiguration.tsx": {
"no-nested-ternary": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/ContentCategoryConfiguration.tsx": {
"no-nested-ternary": {
"count": 3
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/ContentFilterDisplay.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/content_filter/ContentFilterManager.tsx": {
"max-params": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/custom_code/CustomCodeModal.tsx": {
"no-nested-ternary": {
"count": 6
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/edit_guardrail_form.tsx": {
"no-restricted-imports": {
"count": 1
},
"no-restricted-syntax": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_info.tsx": {
"max-params": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 3
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_optional_params.tsx": {
"no-nested-ternary": {
"count": 5
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_provider_fields.tsx": {
"no-nested-ternary": {
"count": 5
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/guardrail_table.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/guardrails/_components/tool_permission/ToolPermissionRulesEditor.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/purity": {
"count": 1
}
},
"src/components/key_team_helpers/key_list.tsx": {
"react-hooks/set-state-in-effect": {
"count": 1
@ -2080,134 +2268,6 @@
"count": 1
}
},
"src/app/(dashboard)/policies/_components/add_attachment_form.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/add_policy_form.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/ai_suggestion_modal.tsx": {
"no-nested-ternary": {
"count": 10
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/attachment_table.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/attachment_table.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/guardrail_selection_modal.tsx": {
"no-nested-ternary": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/impact_popover.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/impact_popover.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/index.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/pipeline_flow_builder.tsx": {
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 2
}
},
"src/app/(dashboard)/policies/_components/policy_info.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_table.test.tsx": {
"react/display-name": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_table.tsx": {
"no-nested-ternary": {
"count": 2
},
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/policy_test_panel.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
}
},
"src/app/(dashboard)/policies/_components/template_parameter_modal.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/immutability": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/components/price_data_reload.tsx": {
"react-hooks/immutability": {
"count": 2
@ -2272,32 +2332,6 @@
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/TagTable.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/components/CreateTagModal.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/tag-management/_components/tag_info.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/components/team/EditMembership.tsx": {
"no-nested-ternary": {
"count": 1
@ -2388,43 +2422,6 @@
"count": 2
}
},
"src/app/(dashboard)/vector-stores/_components/CreateVectorStore.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx": {
"no-nested-ternary": {
"count": 2
},
"no-restricted-imports": {
"count": 1
},
"react/no-unescaped-entities": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/VectorStoreTable.tsx": {
"no-restricted-imports": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/index.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/app/(dashboard)/vector-stores/_components/vector_store_info.tsx": {
"no-restricted-imports": {
"count": 1
},
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/components/view_logs/EvalViewer/EvalViewer.tsx": {
"no-nested-ternary": {
"count": 1

View file

@ -1,16 +1,10 @@
import { CopyOutlined } from "@ant-design/icons";
import { ChevronDownIcon, ChevronUpIcon, SwitchVerticalIcon, TrashIcon } from "@heroicons/react/outline";
import {
ColumnDef,
flexRender,
getCoreRowModel,
getSortedRowModel,
SortingState,
useReactTable,
} from "@tanstack/react-table";
import { Badge, Button, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow } from "@tremor/react";
import { TrashIcon } from "@heroicons/react/outline";
import { ColumnDef, PaginationState, SortingState } from "@tanstack/react-table";
import { Badge, Button } from "@tremor/react";
import { Tooltip } from "antd";
import React, { useState } from "react";
import { DataTable, DataTableSortHeader } from "@/components/shared/DataTable";
import { DateCell, IdCell, StatusBadge } from "@/components/shared/table_cells";
import NotificationsManager from "@/components/molecules/notifications_manager";
import { getCategoryBadgeColor } from "@/components/claude_code_plugins/helpers";
@ -25,15 +19,9 @@ interface PluginTableProps {
onPluginClick: (pluginId: string) => void;
}
const PluginTable: React.FC<PluginTableProps> = ({
pluginsList,
isLoading,
onDeleteClick,
accessToken,
isAdmin,
onPluginClick,
}) => {
const PluginTable: React.FC<PluginTableProps> = ({ pluginsList, isLoading, onDeleteClick, isAdmin, onPluginClick }) => {
const [sorting, setSorting] = useState<SortingState>([{ id: "created_at", desc: true }]);
const [pagination, setPagination] = useState<PaginationState>({ pageIndex: 0, pageSize: 25 });
const copyToClipboard = (text: string) => {
navigator.clipboard.writeText(text);
@ -42,7 +30,8 @@ const PluginTable: React.FC<PluginTableProps> = ({
const columns: ColumnDef<Plugin>[] = [
{
header: "Skill Name",
id: "name",
header: ({ column }) => <DataTableSortHeader column={column} title="Skill Name" />,
accessorKey: "name",
cell: ({ row }) => {
const plugin = row.original;
@ -63,16 +52,20 @@ const PluginTable: React.FC<PluginTableProps> = ({
},
},
{
id: "version",
header: "Version",
accessorKey: "version",
enableSorting: false,
cell: ({ row }) => {
const version = row.original.version || "N/A";
return <span className="text-xs text-gray-600">{version}</span>;
},
},
{
id: "description",
header: "Description",
accessorKey: "description",
enableSorting: false,
cell: ({ row }) => {
const description = row.original.description || "No description";
return (
@ -83,7 +76,8 @@ const PluginTable: React.FC<PluginTableProps> = ({
},
},
{
header: "Category",
id: "category",
header: ({ column }) => <DataTableSortHeader column={column} title="Category" />,
accessorKey: "category",
cell: ({ row }) => {
const category = row.original.category;
@ -103,7 +97,8 @@ const PluginTable: React.FC<PluginTableProps> = ({
},
},
{
header: "Public",
id: "enabled",
header: ({ column }) => <DataTableSortHeader column={column} title="Public" />,
accessorKey: "enabled",
cell: ({ row }) => {
const plugin = row.original;
@ -117,17 +112,19 @@ const PluginTable: React.FC<PluginTableProps> = ({
},
},
{
header: "Created At",
id: "created_at",
header: ({ column }) => <DataTableSortHeader column={column} title="Created At" />,
accessorKey: "created_at",
cell: ({ row }) => <DateCell value={row.original.created_at} />,
},
...(isAdmin
? [
{
header: "Actions",
id: "actions",
header: "Actions",
enableSorting: false,
cell: ({ row }: any) => {
meta: { pinned: "right" as const },
cell: ({ row }: { row: { original: Plugin } }) => {
const plugin = row.original;
return (
@ -153,98 +150,22 @@ const PluginTable: React.FC<PluginTableProps> = ({
: []),
];
const table = useReactTable({
data: pluginsList,
columns,
state: {
sorting,
},
onSortingChange: setSorting,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
enableSorting: true,
});
return (
<div className="rounded-lg custom-border relative">
<div className="overflow-x-auto">
<Table className="[&_td]:py-0.5 [&_th]:py-1">
<TableHead>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => (
<TableHeaderCell
key={header.id}
className={`py-1 h-8 ${
header.id === "actions" ? "sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]" : ""
}`}
onClick={header.column.getCanSort() ? header.column.getToggleSortingHandler() : undefined}
>
<div className="flex items-center justify-between gap-2">
<div className="flex items-center">
{header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
</div>
{header.column.getCanSort() && (
<div className="w-4">
{header.column.getIsSorted() ? (
{
asc: <ChevronUpIcon className="h-4 w-4 text-blue-500" />,
desc: <ChevronDownIcon className="h-4 w-4 text-blue-500" />,
}[header.column.getIsSorted() as string]
) : (
<SwitchVerticalIcon className="h-4 w-4 text-gray-400" />
)}
</div>
)}
</div>
</TableHeaderCell>
))}
</TableRow>
))}
</TableHead>
<TableBody>
{isLoading ? (
<TableRow>
<TableCell colSpan={columns.length} className="h-8 text-center">
<div className="text-center text-gray-500">
<p>Loading...</p>
</div>
</TableCell>
</TableRow>
) : pluginsList && pluginsList.length > 0 ? (
table.getRowModel().rows.map((row) => (
<TableRow
key={row.id}
className="h-8 cursor-pointer hover:bg-gray-50"
onClick={() => onPluginClick(row.original.id)}
>
{row.getVisibleCells().map((cell) => (
<TableCell
key={cell.id}
className={`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${
cell.column.id === "actions"
? "sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]"
: ""
}`}
>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
))}
</TableRow>
))
) : (
<TableRow>
<TableCell colSpan={columns.length} className="h-8 text-center">
<div className="text-center text-gray-500">
<p>No skills found. Add one to get started.</p>
</div>
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</div>
</div>
<DataTable
data={pluginsList}
columns={columns}
sortingMode="client"
sorting={sorting}
onSortingChange={setSorting}
paginationMode="client"
pagination={pagination}
onPaginationChange={setPagination}
onRowClick={(plugin) => onPluginClick(plugin.id)}
isLoading={isLoading}
loadingMessage="Loading skills..."
noDataMessage="No skills found. Add one to get started."
size="compact"
/>
);
};