PluginProbe
Parse.ly / 3.24.2
Parse.ly v3.24.2
3.24.3 3.24.2 3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 All 107 releases
wp-parsely / src / content-helper / common / verify-credentials.tsx

verify-credentials.tsx in Parse.ly 3.24.2, at src/content-helper/common/verify-credentials.tsx

39 lines 1005 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Internal dependencies
3 */
4 import {
5 ContentHelperErrorMessageProps,
6 EmptyCredentialsMessage,
7 } from './content-helper-error-message';
8
9 /**
10 * Defines the props structure for VerifyCredentials.
11 *
12 * @since 3.9.0
13 */
14 interface VerifyCredentialsProps {
15 children: React.ReactNode;
16 }
17
18 /**
19 * Returns the passed children or an error message JSX Element if credentials
20 * are empty.
21 *
22 * @since 3.9.0
23 *
24 * @param {VerifyCredentialsProps} props The component's props.
25 * @param {ContentHelperErrorMessageProps|null} errorMessageProps The error message's props.
26 *
27 * @return {import('react').JSX.Element} The passed JSX Element or the error message JSX Element.
28 */
29 export const VerifyCredentials = (
30 { children }: VerifyCredentialsProps,
31 errorMessageProps: ContentHelperErrorMessageProps|null = null
32 ): React.JSX.Element => {
33 if ( window.wpParselyEmptyCredentialsMessage ) {
34 return <EmptyCredentialsMessage { ...errorMessageProps } />;
35 }
36
37 return <>{ children }</>;
38 };
39