mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +02:00
* minor archive table updates * archived date cell * archive import paths * move project health table files * fix: align actions cells * simplify health table row mapping * fix project pages browser tab title * initial draft of virtualized table component * refactor: virtualized table common component * fix: health report name cell width * refactor: report cell paths
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
|
|
import { SortingRule } from 'react-table';
|
|
import { useProjectFeaturesArchive } from 'hooks/api/getters/useProjectFeaturesArchive/useProjectFeaturesArchive';
|
|
import { createLocalStorage } from 'utils/createLocalStorage';
|
|
|
|
const defaultSort: SortingRule<string> = { id: 'archivedAt' };
|
|
|
|
interface IProjectFeaturesTable {
|
|
projectId: string;
|
|
}
|
|
|
|
export const ProjectFeaturesArchiveTable = ({
|
|
projectId,
|
|
}: IProjectFeaturesTable) => {
|
|
const {
|
|
archivedFeatures = [],
|
|
refetchArchived,
|
|
loading,
|
|
} = useProjectFeaturesArchive(projectId);
|
|
|
|
const { value, setValue } = createLocalStorage(
|
|
`${projectId}:ProjectFeaturesArchiveTable`,
|
|
defaultSort
|
|
);
|
|
|
|
return (
|
|
<ArchiveTable
|
|
title="Project archive"
|
|
archivedFeatures={archivedFeatures}
|
|
loading={loading}
|
|
storedParams={value}
|
|
setStoredParams={setValue}
|
|
refetch={refetchArchived}
|
|
projectId={projectId}
|
|
/>
|
|
);
|
|
};
|