/** * WordPress dependencies */ import { _n, sprintf, isRTL } from '@wordpress/i18n'; import { useEffect, useRef } from '@wordpress/element'; import { useNavigator, __experimentalText as WCText, Button, Flex, FlexItem, } from '@wordpress/components'; import { Icon, chevronLeft, chevronRight } from '@wordpress/icons'; import type { FontFamily } from '@wordpress/core-data'; /** * Internal dependencies */ import FontDemo from './font-demo'; function FontCard( { font, onClick, variantsText, navigatorPath, shouldFocus, }: { font: FontFamily; onClick: () => void; variantsText?: string; navigatorPath?: string; shouldFocus?: boolean; } ) { const variantsCount = font.fontFace?.length || 1; const style = { cursor: !! onClick ? 'pointer' : 'default', }; const navigator = useNavigator(); const ref = useRef< HTMLButtonElement >( null ); useEffect( () => { if ( shouldFocus ) { ref.current?.focus(); } }, [ shouldFocus ] ); return ( ); } export default FontCard;