@keystatic/core

Search for an npm package
import { useMemo } from 'react';
import { z as useConfig, a as useTree, t as getEntriesInCollectionWithTreeKey } from './index-041d8a0b.js';
function useSlugsInCollection(collection) {
const config = useConfig();
const tree = useTree().current;
return useMemo(() => {
const loadedTree = tree.kind === 'loaded' ? tree.data.tree : new Map();
return getEntriesInCollectionWithTreeKey(config, collection, loadedTree).map(x => x.slug);
}, [config, tree, collection]);
}
export { useSlugsInCollection as u };