UNPKG

@wordpress/block-library

Version:
40 lines (38 loc) 1.07 kB
import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { BlockIcon, MediaPlaceholder } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; import { cover as icon } from '@wordpress/icons'; /** * Internal dependencies */ import { ALLOWED_MEDIA_TYPES } from '../shared'; export default function CoverPlaceholder(_ref) { let { disableMediaButtons = false, children, onSelectMedia, onError, style, toggleUseFeaturedImage } = _ref; return createElement(MediaPlaceholder, { icon: createElement(BlockIcon, { icon: icon }), labels: { title: __('Cover'), instructions: __('Drag and drop onto this block, upload, or select existing media from your library.') }, onSelect: onSelectMedia, accept: "image/*,video/*", allowedTypes: ALLOWED_MEDIA_TYPES, disableMediaButtons: disableMediaButtons, onToggleFeaturedImage: toggleUseFeaturedImage, onError: onError, style: style }, children); } //# sourceMappingURL=cover-placeholder.js.map