Server IP : 172.67.158.161 / Your IP : 3.145.166.241 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/validation/ |
Upload File : |
/** * External dependencies */ import { useValidationContext } from '@woocommerce/base-context'; import PropTypes from 'prop-types'; /** * Internal dependencies */ import './style.scss'; export const ValidationInputError = ( { errorMessage = '', propertyName = '', elementId = '', } ) => { const { getValidationError, getValidationErrorId } = useValidationContext(); if ( ! errorMessage ) { const error = getValidationError( propertyName ) || {}; if ( error.message && ! error.hidden ) { errorMessage = error.message; } else { return null; } } return ( <div className="wc-block-components-validation-error" role="alert"> <p id={ getValidationErrorId( elementId ) }>{ errorMessage }</p> </div> ); }; ValidationInputError.propTypes = { errorMessage: PropTypes.string, propertyName: PropTypes.string, elementId: PropTypes.string, };