UNPKG

@wordpress/widget-dashboard

Version:

Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.

1 lines • 1.53 kB
{"version":3,"file":"widget-frame-footer.cjs","names":["useRuntimeActions","splitWidgetActions","WidgetFooter"],"sources":["../../../src/components/widget-frame/widget-frame-footer.tsx"],"sourcesContent":["import type { WidgetType } from '@wordpress/widget-primitives';\nimport { useRuntimeActions } from '../../hooks/use-runtime-actions';\nimport { splitWidgetActions } from '../../utils/split-widget-actions';\nimport { WidgetFooter } from '../widget-footer';\nimport type { DashboardWidget } from '../../types';\n\ninterface WidgetFrameFooterProps {\n\twidget: DashboardWidget< unknown >;\n\twidgetType: WidgetType;\n\teditMode?: boolean;\n}\n\n/**\n * The frame's footer. Subscribes to the instance's runtime actions here,\n * so a declaration never re-renders the body.\n *\n * @param {WidgetFrameFooterProps} props Component props.\n */\nexport function WidgetFrameFooter( {\n\twidget,\n\twidgetType,\n\teditMode = false,\n}: WidgetFrameFooterProps ): React.ReactNode {\n\tconst runtimeActions = useRuntimeActions( widget.uuid );\n\tconst { footer } = splitWidgetActions( widgetType, runtimeActions );\n\n\treturn (\n\t\t<WidgetFooter\n\t\t\tuuid={ widget.uuid }\n\t\t\tactions={ footer }\n\t\t\teditMode={ editMode }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAAgB,kBAAmB,EAClC,QACA,YACA,WAAW,SACiC;CAC5C,MAAM,kBAAA,GAAiBA,mCAAAA,kBAAAA,CAAmB,OAAO,IAAK;CACtD,MAAM,EAAE,YAAA,GAAWC,oCAAAA,mBAAAA,CAAoB,YAAY,cAAe;CAElE,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,cAAD;EACC,MAAO,OAAO;EACd,SAAU;EACC;CACX,CAAA;AAEH"}