/** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { useContext } from '@wordpress/element'; import { SelectControl } from '@wordpress/components'; import { Link, Stack, Text } from '@wordpress/ui'; /** * Internal dependencies */ import { AdminContext } from '../../index'; import { useSearchVisibility } from '../index'; import ItemHelp from '../components/item-help'; export default function FontFamily() { const { editorOptions, setEditorOptions } = useContext( AdminContext ); const title = __( 'Font family', 'custom-html-block-extension' ); const isVisible = useSearchVisibility( title ); if ( ! isVisible ) { return null; } const onChange = ( value: string ) => { setEditorOptions( { ...editorOptions, fontFamily: value, } ); }; return ( ( { label: label ?? name, value: name, } ) ), { label: __( 'Monospace', 'custom-html-block-extension' ), value: 'monospace', }, ] } onChange={ onChange } /> }> { __( 'You can use your own favorite fonts in addition to the default fonts. Please refer to the following document for instructions on how to add custom fonts.', 'custom-html-block-extension' ) } }> { __( 'GitHub project page', 'custom-html-block-extension' ) } } /> ); }