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
2022-06-07 13:23:15 +03:00

37 lines
1.2 KiB
TypeScript

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';
import { usePageTitle } from '../../hooks/usePageTitle';
const defaultSort: SortingRule<string> = { id: 'createdAt', desc: true };
export const FeaturesArchiveTable = () => {
usePageTitle('Archived');
const {
archivedFeatures = [],
loading,
refetchArchived,
} = useFeaturesArchive();
const [searchParams, setSearchParams] = useSearchParams();
const [storedParams, setStoredParams] = useLocalStorage(
'FeaturesArchiveTable:v1',
defaultSort
);
return (
<ArchiveTable
title={'Archived'}
archivedFeatures={archivedFeatures}
loading={loading}
searchParams={searchParams}
setSearchParams={setSearchParams}
storedParams={storedParams}
setStoredParams={setStoredParams}
refetch={refetchArchived}
/>
);
};