All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.js.ddm_template_editor.components.ClosableAlert.js Maven / Gradle / Ivy

There is a newer version: 1.0.95
Show newest version
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

import ClayAlert from '@clayui/alert';
import PropTypes from 'prop-types';
import React, {useState} from 'react';

export function ClosableAlert({id, message, visible: initialVisible}) {
	const [visible, setVisible] = useState(!!initialVisible);

	return (
		visible && (
			 setVisible(false)}
				title={Liferay.Language.get('warning')}
			>
				{message}
			
		)
	);
}

ClosableAlert.propTypes = {
	id: PropTypes.string,
	message: PropTypes.string.isRequired,
	visible: PropTypes.bool.isRequired,
};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy