import {__} from '@wordpress/i18n';

/**
 * AdPresso - Manual Link Component
 * =================================
 * Equivalent to the PHP `create_manual_link` method.
 * Renders a standardized link to the documentation.
 *
 * @param {string} url - The URL to the documentation.
 * @param {string} text - Optional link text. Defaults to 'Learn more.'.
 */
const ManualLink = ( {url, text} ) => {
	if ( !url ) {
		return null;
	}

	const displayText = text || __( 'Learn more.', 'adpresso' );

	return (
		<a
			href={url}
			target="_blank"
			rel="noopener noreferrer"
			className="adpresso-manual-link"
		>
			<span className="dashicons dashicons-welcome-learn-more"></span>
		</a>
	);
};

export default ManualLink;
