| 'use strict'; |
|
|
| var React = require('react'); |
| var cloudImagePreview = require('./cloud-image-preview-ffbfc21c.node.cjs.js'); |
|
|
| function useSlugsInCollection(collection) { |
| const config = cloudImagePreview.useConfig(); |
| const tree = cloudImagePreview.useTree().current; |
| return React.useMemo(() => { |
| const loadedTree = tree.kind === 'loaded' ? tree.data.tree : new Map(); |
| return cloudImagePreview.getEntriesInCollectionWithTreeKey(config, collection, loadedTree).map(x => x.slug); |
| }, [config, tree, collection]); |
| } |
|
|
| exports.useSlugsInCollection = useSlugsInCollection; |