/** * WordPress dependencies */ import { NoticeList } from '@safe-wordpress/components'; import { useSelect, useDispatch } from '@safe-wordpress/data'; import { store as NOTICES } from '@safe-wordpress/notices'; /** * Internal dependencies */ import { PageTitle } from '../page-title'; import { SettingsTable } from '../settings'; import type { Settings } from '../../types'; export type LayoutProps = { readonly settings: Settings; }; export const Layout = ( { settings }: LayoutProps ): JSX.Element => { const { hideTitle } = settings; const notices = useNotices(); const { removeNotice } = useDispatch( NOTICES ); return ( <> { ! hideTitle && } void removeNotice( noticeId ) } /> ); }; // ===== // HOOKS // ===== const useNotices = () => useSelect( ( select ) => select( NOTICES ).getNotices() );