mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
chore(deps): upgrade react-table to v8 [EE-4837] (#8245)
This commit is contained in:
parent
f20d3e72b9
commit
757461d58b
140 changed files with 1805 additions and 2872 deletions
|
@ -1,39 +1,31 @@
|
|||
import { History } from 'lucide-react';
|
||||
import { useStore } from 'zustand';
|
||||
|
||||
import { NomadEvent } from '@/react/nomad/types';
|
||||
|
||||
import { Datatable } from '@@/datatables';
|
||||
import { useSearchBarState } from '@@/datatables/SearchBar';
|
||||
import { createPersistedStore } from '@@/datatables/types';
|
||||
import { useTableState } from '@@/datatables/useTableState';
|
||||
|
||||
import { useColumns } from './columns';
|
||||
import { columns } from './columns';
|
||||
|
||||
export interface EventsDatatableProps {
|
||||
data: NomadEvent[];
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const storageKey = 'events';
|
||||
const storageKey = 'nomad_events';
|
||||
|
||||
const settingsStore = createPersistedStore(storageKey, 'Date');
|
||||
const settingsStore = createPersistedStore(storageKey, 'date');
|
||||
|
||||
export function EventsDatatable({ data, isLoading }: EventsDatatableProps) {
|
||||
const columns = useColumns();
|
||||
const settings = useStore(settingsStore);
|
||||
const [search, setSearch] = useSearchBarState(storageKey);
|
||||
const tableState = useTableState(settingsStore, storageKey);
|
||||
|
||||
return (
|
||||
<Datatable
|
||||
isLoading={isLoading}
|
||||
settingsManager={tableState}
|
||||
columns={columns}
|
||||
dataset={data}
|
||||
initialPageSize={settings.pageSize}
|
||||
onPageSizeChange={settings.setPageSize}
|
||||
initialSortBy={settings.sortBy}
|
||||
onSortByChange={settings.setSortBy}
|
||||
searchValue={search}
|
||||
onSearchChange={setSearch}
|
||||
titleIcon={History}
|
||||
title="Events"
|
||||
totalCount={data.length}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue