portainer/app/react/nomad/jobs/JobsView/JobsDatatable/JobsDatatableSettings.tsx

20 lines
577 B
TypeScript
Raw Normal View History

import { TableSettingsMenuAutoRefresh } from '@@/datatables/TableSettingsMenuAutoRefresh';
import { useTableSettings } from '@@/datatables/useTableSettings';
import { JobsTableSettings } from './types';
export function JobsDatatableSettings() {
const { settings, setTableSettings } = useTableSettings<JobsTableSettings>();
return (
<TableSettingsMenuAutoRefresh
value={settings.autoRefreshRate}
onChange={handleRefreshRateChange}
/>
);
function handleRefreshRateChange(autoRefreshRate: number) {
setTableSettings({ autoRefreshRate });
}
}