Server IP : 104.21.14.103 / Your IP : 18.218.223.84 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/base/components/summary/ |
Upload File : |
/** * External dependencies */ import { RawHTML, useMemo } from '@wordpress/element'; /** * Internal dependencies */ import { generateSummary } from './utils'; /** * Summary component. * * @param {Object} props Component props. * @param {string} props.source Source text. * @param {number} props.maxLength Max length of the summary, using countType. * @param {string} props.countType One of words, characters_excluding_spaces, or characters_including_spaces. * @param {string} props.className Class name for rendered component. */ export const Summary = ( { source, maxLength = 15, countType = 'words', className = '', } ) => { const summaryText = useMemo( () => { return generateSummary( source, maxLength, countType ); }, [ source, maxLength, countType ] ); return <RawHTML className={ className }>{ summaryText }</RawHTML>; }; export default Summary;