1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/frontend/src/component/archive/FeaturesArchiveTable.tsx

33 lines
936 B
TypeScript
Raw Normal View History

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
const defaultSort: SortingRule<string> = { id: 'createdAt' };
const { value, setValue } = createLocalStorage(
'FeaturesArchiveTable:v1',
defaultSort,
);
2022-06-06 11:12:28 +02:00
export const FeaturesArchiveTable = () => {
usePageTitle('Archive');
2022-06-06 11:12:28 +02:00
const {
archivedFeatures = [],
loading,
refetchArchived,
} = useFeaturesArchive();
return (
<ArchiveTable
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}
/>
);
};