@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
1 lines • 1.4 kB
Source Map (JSON)
{"version":3,"file":"widget-frame-footer.mjs","names":[],"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,iBAAiB,kBAAmB,OAAO,IAAK;CACtD,MAAM,EAAE,WAAW,mBAAoB,YAAY,cAAe;CAElE,OACC,oBAAC,cAAD;EACC,MAAO,OAAO;EACd,SAAU;EACC;CACX,CAAA;AAEH"}