Make all tool filtering configurable for developers

This commit is contained in:
James Brunton 2025-08-20 16:32:22 +01:00
parent 2ca823aced
commit 32324cf27e

View File

@ -15,7 +15,7 @@ import SingleLargePage from '../tools/SingleLargePage';
import UnlockPdfForms from '../tools/UnlockPdfForms';
import RemoveCertificateSign from '../tools/RemoveCertificateSign';
const showPlaceholderTools = false; // For development purposes. Allows seeing the full list of tools, even if they're unimplemented
// Hook to get the translated tool registry
export function useFlatToolRegistry(): ToolRegistry {
@ -618,6 +618,9 @@ export function useFlatToolRegistry(): ToolRegistry {
},
};
if (showPlaceholderTools) {
return allTools;
} else {
const filteredTools = Object.keys(allTools)
.filter(key => allTools[key].component !== null || allTools[key].link)
.reduce((obj, key) => {
@ -626,3 +629,4 @@ export function useFlatToolRegistry(): ToolRegistry {
}, {} as ToolRegistry);
return filteredTools;
}
}