-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
index.js
63 lines (58 loc) · 1.59 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* Defines as extensibility slot for the Summary panel.
*/
/**
* WordPress dependencies
*/
import { createSlotFill, PanelRow } from '@wordpress/components';
const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );
/**
* Renders a row in the Summary panel of the Document sidebar.
* It should be noted that this is named and implemented around the function it serves
* and not its location, which may change in future iterations.
*
* @param {Object} props Component properties.
* @param {string} [props.className] An optional class name added to the row.
* @param {Element} props.children Children to be rendered.
*
* @example
* ```js
* // Using ES5 syntax
* var __ = wp.i18n.__;
* var PluginPostStatusInfo = wp.editor.PluginPostStatusInfo;
*
* function MyPluginPostStatusInfo() {
* return React.createElement(
* PluginPostStatusInfo,
* {
* className: 'my-plugin-post-status-info',
* },
* __( 'My post status info' )
* )
* }
* ```
*
* @example
* ```jsx
* // Using ESNext syntax
* import { __ } from '@wordpress/i18n';
* import { PluginPostStatusInfo } from '@wordpress/editor';
*
* const MyPluginPostStatusInfo = () => (
* <PluginPostStatusInfo
* className="my-plugin-post-status-info"
* >
* { __( 'My post status info' ) }
* </PluginPostStatusInfo>
* );
* ```
*
* @return {Component} The component to be rendered.
*/
const PluginPostStatusInfo = ( { children, className } ) => (
<Fill>
<PanelRow className={ className }>{ children }</PanelRow>
</Fill>
);
PluginPostStatusInfo.Slot = Slot;
export default PluginPostStatusInfo;