mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Related to: - https://linear.app/unleash/issue/2-3366/remove-get-apiadminarchivefeatures-deprecated-in-4100 - https://linear.app/unleash/issue/2-3367/remove-get-apiadminarchivefeaturesprojectid-deprecated-in-4110 Brings back the overall flag archive page and table using the feature flag search endpoint.
		
			
				
	
	
		
			35 lines
		
	
	
		
			974 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			974 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { ArchiveTable } from 'component/archive/ArchiveTable/ArchiveTable';
 | 
						|
import type { SortingRule } from 'react-table';
 | 
						|
import { usePageTitle } from 'hooks/usePageTitle';
 | 
						|
import { createLocalStorage } from 'utils/createLocalStorage';
 | 
						|
import { useFeatureSearch } from 'hooks/api/getters/useFeatureSearch/useFeatureSearch';
 | 
						|
 | 
						|
const defaultSort: SortingRule<string> = { id: 'createdAt' };
 | 
						|
const { value, setValue } = createLocalStorage(
 | 
						|
    'FeaturesArchiveTable:v1',
 | 
						|
    defaultSort,
 | 
						|
);
 | 
						|
 | 
						|
export const FeaturesArchiveTable = () => {
 | 
						|
    usePageTitle('Archive');
 | 
						|
 | 
						|
    const {
 | 
						|
        features: archivedFeatures,
 | 
						|
        loading,
 | 
						|
        refetch,
 | 
						|
    } = useFeatureSearch({
 | 
						|
        archived: 'IS:true',
 | 
						|
    });
 | 
						|
 | 
						|
    return (
 | 
						|
        <ArchiveTable
 | 
						|
            title='Archive'
 | 
						|
            archivedFeatures={archivedFeatures}
 | 
						|
            loading={loading}
 | 
						|
            storedParams={value}
 | 
						|
            setStoredParams={setValue}
 | 
						|
            refetch={refetch}
 | 
						|
        />
 | 
						|
    );
 | 
						|
};
 |