1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/frontend/src/component/archive/FeaturesArchiveTable.tsx

37 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-06-06 11:12:28 +02:00
import { useFeaturesArchive } from '../../hooks/api/getters/useFeaturesArchive/useFeaturesArchive';
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
import { useSearchParams } from 'react-router-dom';
import { useLocalStorage } from '../../hooks/useLocalStorage';
import { SortingRule } from 'react-table';
2022-06-07 10:54:16 +02:00
import { usePageTitle } from '../../hooks/usePageTitle';
2022-06-06 11:12:28 +02:00
const defaultSort: SortingRule<string> = { id: 'createdAt', desc: true };
export const FeaturesArchiveTable = () => {
2022-06-07 10:54:16 +02:00
usePageTitle('Archived');
2022-06-06 11:12:28 +02:00
const {
archivedFeatures = [],
loading,
refetchArchived,
} = useFeaturesArchive();
const [searchParams, setSearchParams] = useSearchParams();
const [storedParams, setStoredParams] = useLocalStorage(
'FeaturesArchiveTable:v1',
defaultSort
);
return (
<ArchiveTable
2022-06-07 12:23:15 +02:00
title={'Archived'}
2022-06-06 11:12:28 +02:00
archivedFeatures={archivedFeatures}
loading={loading}
searchParams={searchParams}
setSearchParams={setSearchParams}
storedParams={storedParams}
setStoredParams={setStoredParams}
refetch={refetchArchived}
/>
);
};