/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import { Icon, wordpress } from '@wordpress/icons';
import { getSetting } from '@woocommerce/wc-admin-settings';
import { useSelect } from '@wordpress/data';
const Header = () => {
const siteTitle = getSetting( 'siteTitle', '' );
const siteUrl = getSetting( 'siteUrl', '' );
const toggleFolded = () => {
document.body.classList.toggle( 'is-folded' );
};
let buttonIcon = ;
const { isRequestingSiteIcon, siteIconUrl } = useSelect( ( select ) => {
const { isResolving } = select( 'core/data' );
const { getEntityRecord } = select( 'core' );
const siteData =
getEntityRecord( 'root', '__unstableBase', undefined ) || {};
return {
isRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [
'root',
'__unstableBase',
undefined,
] ),
siteIconUrl: siteData.siteIconUrl,
};
} );
if ( siteIconUrl ) {
buttonIcon = ;
} else if ( isRequestingSiteIcon ) {
buttonIcon = null;
}
return (
);
};
export default Header;