/** * WordPress dependencies */ import { __experimentalVStack as VStack, __experimentalHStack as HStack, __experimentalHeading as Heading, __experimentalSpacer as Spacer, Button, __experimentalText as Text, } from '../../../components'; import { closeSmall } from '../../../icons'; import { __ } from '../../../i18n'; import type { ButtonProps } from '@wordpress/components/build-types/button/types'; import './style.scss'; interface InspectorPopoverHeaderAction { label: string; icon?: ButtonProps[ 'icon' ] | JSX.Element; onClick: () => void; } interface InspectorPopoverHeaderProps { title: React.ReactNode; help?: React.ReactNode; actions?: InspectorPopoverHeaderAction[]; onClose?: () => void; } export default function InspectorPopoverHeader( { title, help, actions = [], onClose, }: InspectorPopoverHeaderProps ): JSX.Element { return ( { title } { actions.map( ( { label, icon, onClick } ) => ( ) ) } { onClose && (