2022-06-15 15:16:42 +02:00
|
|
|
import { useFeaturesArchive } from 'hooks/api/getters/useFeaturesArchive/useFeaturesArchive';
|
2022-06-06 11:12:28 +02:00
|
|
|
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
|
|
|
|
2022-06-15 15:16:42 +02:00
|
|
|
const defaultSort: SortingRule<string> = { id: 'createdAt' };
|
2022-06-13 15:22:27 +02:00
|
|
|
const { value, setValue } = createLocalStorage(
|
|
|
|
'FeaturesArchiveTable:v1',
|
2023-10-02 14:25:46 +02:00
|
|
|
defaultSort,
|
2022-06-13 15:22:27 +02:00
|
|
|
);
|
2022-06-06 11:12:28 +02:00
|
|
|
|
|
|
|
export const FeaturesArchiveTable = () => {
|
2022-06-15 15:16:42 +02:00
|
|
|
usePageTitle('Archive');
|
|
|
|
|
2022-06-06 11:12:28 +02:00
|
|
|
const {
|
|
|
|
archivedFeatures = [],
|
|
|
|
loading,
|
|
|
|
refetchArchived,
|
|
|
|
} = useFeaturesArchive();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ArchiveTable
|
2023-10-02 14:25:46 +02:00
|
|
|
title='Archive'
|
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}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|