| import { useMemo } from 'react'; |
| import { d as useConfig, b as useTree, c as getEntriesInCollectionWithTreeKey } from './cloud-image-preview-5844b305.node.esm.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 }; |