2022-06-06 11:12:28 +02:00
|
|
|
import { useFeaturesArchive } from '../../hooks/api/getters/useFeaturesArchive/useFeaturesArchive';
|
|
|
|
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
|
|
|
|
import { SortingRule } from 'react-table';
|
2022-06-10 08:34:42 +02:00
|
|
|
import { usePageTitle } from 'hooks/usePageTitle';
|
|
|
|
import { createLocalStorage } from 'utils/createLocalStorage';
|
2022-06-06 11:12:28 +02:00
|
|
|
|
|
|
|
const defaultSort: SortingRule<string> = { id: 'createdAt', desc: true };
|
2022-06-13 15:22:27 +02:00
|
|
|
const { value, setValue } = createLocalStorage(
|
|
|
|
'FeaturesArchiveTable:v1',
|
|
|
|
defaultSort
|
|
|
|
);
|
2022-06-06 11:12:28 +02:00
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ArchiveTable
|
2022-06-10 15:04:06 +02:00
|
|
|
title="Archived"
|
2022-06-06 11:12:28 +02:00
|
|
|
archivedFeatures={archivedFeatures}
|
|
|
|
loading={loading}
|
2022-06-10 08:34:42 +02:00
|
|
|
storedParams={value}
|
|
|
|
setStoredParams={setValue}
|
2022-06-06 11:12:28 +02:00
|
|
|
refetch={refetchArchived}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|