@keystatic/core

Search for an npm package
'use strict';
var React = require('react');
var cloudImagePreview = require('./cloud-image-preview-6bec9009.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;