// Reference: https://github.com/WordPress/gutenberg/blob/v16.4.0/packages/edit-site/src/components/site-hub/index.js /* eslint-disable @woocommerce/dependency-group */ /* eslint-disable @typescript-eslint/ban-ts-comment */ /** * External dependencies */ import classnames from 'classnames'; import { useSelect } from '@wordpress/data'; import { // @ts-ignore No types for this exist yet. __unstableMotion as motion, // @ts-ignore No types for this exist yet. __unstableAnimatePresence as AnimatePresence, // @ts-ignore No types for this exist yet. __experimentalHStack as HStack, } from '@wordpress/components'; import { useReducedMotion } from '@wordpress/compose'; // @ts-ignore No types for this exist yet. import { store as coreStore } from '@wordpress/core-data'; import { decodeEntities } from '@wordpress/html-entities'; import { forwardRef } from '@wordpress/element'; // @ts-ignore No types for this exist yet. import SiteIcon from '@wordpress/edit-site/build-module/components/site-icon'; /** * Internal dependencies */ const HUB_ANIMATION_DURATION = 0.3; export const SiteHub = forwardRef( ( { isTransparent, ...restProps }: { isTransparent: boolean; className: string; as: string; variants: motion.Variants; }, ref ) => { const { siteTitle } = useSelect( ( select ) => { // @ts-ignore No types for this exist yet. const { getSite } = select( coreStore ); return { siteTitle: getSite()?.title, }; }, [] ); const disableMotion = useReducedMotion(); return ( { decodeEntities( siteTitle ) } ); } );