@@ -33,17 +37,12 @@ export default function TemplatesHeader({ table }: TemplatesHeaderProps) {
- {showFilteredRowCount ? (
- <>
-
- {filteredCount} {filteredCount === 1 ? 'result' : 'results'}
-
- ·
- {totalCount} total
- >
- ) : (
- {totalCount} total
- )}
+
+ {loadedCount} {loadedCount === 1 ? 'template' : 'templates'}
+
+ {isFiltered ? (
+ · filtered
+ ) : null}
)
diff --git a/src/features/dashboard/templates/list/stores/table-store.ts b/src/features/dashboard/templates/list/stores/table-store.ts
index 5efbd4705..db239b7b7 100644
--- a/src/features/dashboard/templates/list/stores/table-store.ts
+++ b/src/features/dashboard/templates/list/stores/table-store.ts
@@ -2,6 +2,7 @@ import type { OnChangeFn, SortingState } from '@tanstack/react-table'
import { create } from 'zustand'
import { createJSONStorage, persist } from 'zustand/middleware'
import { createHashStorage } from '@/lib/utils/store'
+import { TEMPLATES_DEFAULT_SORTING } from '../constants'
import { trackTemplateTableInteraction } from '../table-config'
interface TemplateTableState {
@@ -33,7 +34,7 @@ type Store = TemplateTableState & TemplateTableActions
const initialState: TemplateTableState = {
// Table state
- sorting: [{ id: 'updatedAt', desc: true }],
+ sorting: TEMPLATES_DEFAULT_SORTING,
globalFilter: '',
// Filter state
cpuCount: undefined,
diff --git a/src/features/dashboard/templates/list/table-body.tsx b/src/features/dashboard/templates/list/table-body.tsx
index 4d9f74b80..5722c0771 100644
--- a/src/features/dashboard/templates/list/table-body.tsx
+++ b/src/features/dashboard/templates/list/table-body.tsx
@@ -2,8 +2,10 @@ import { flexRender, type Table } from '@tanstack/react-table'
import type { RefObject } from 'react'
import type { Template } from '@/core/modules/templates/models'
import { useVirtualRows } from '@/lib/hooks/use-virtual-rows'
+import { cn } from '@/lib/utils'
import { DataTableBody, DataTableCell, DataTableRow } from '@/ui/data-table'
import Empty from '@/ui/empty'
+import { LoadMoreButton } from '@/ui/pagination-buttons'
import { Button } from '@/ui/primitives/button'
import { CloseIcon, ExternalLinkIcon } from '@/ui/primitives/icons'
import { useTemplateTableStore } from './stores/table-store'
@@ -16,16 +18,25 @@ interface TemplatesTableBodyProps {
templates: Template[] | undefined
table: Table