import { __ } from '@wordpress/i18n';
import { getNotices } from '../Helpers';
import StatusIcon from './StatusIcon';

const TEXT_DOMAIN = 'stock-sync-with-google-sheet-for-woocommerce';

// "Please activate your license" banner, shown while Ultimate is active without a valid licence.
const LicenseNotice = () => {
	const notices = getNotices();

	if ( ! notices.license ) {
		return null;
	}

	return (
		<div className="ssgsw-banner ssgsw-banner--warning" role="status">
			<StatusIcon type="warning" />
			<p>{ __( 'Please activate your license.', TEXT_DOMAIN ) }</p>
			<a className="ssgsw-banner__action" href={ notices.license_url }>
				{ __( 'Activate Now', TEXT_DOMAIN ) } <span aria-hidden="true">→</span>
			</a>
		</div>
	);
};

export default LicenseNotice;
