// packages/block-library/src/query-title/use-post-type-label.js
import { store as coreStore } from "@wordpress/core-data";
import { useSelect } from "@wordpress/data";
function usePostTypeLabel(contextPostType) {
  const currentPostType = useSelect((select) => {
    const { getCurrentPostType } = select("core/editor");
    return getCurrentPostType();
  }, []);
  return useSelect(
    (select) => {
      const { getPostType } = select(coreStore);
      const postTypeSlug = contextPostType || currentPostType;
      const postType = getPostType(postTypeSlug);
      return {
        postTypeLabel: postType ? postType.labels.singular_name : ""
      };
    },
    [contextPostType, currentPostType]
  );
}
export {
  usePostTypeLabel
};
//# sourceMappingURL=use-post-type-label.js.map
