<?php
/**
 * Getting started card.
 *
 * @package AdvancedAds
 * @author  Advanced Ads <info@wpadvancedads.com>
 */

$items = $this->get_links( '/bwl_kb?bkb_category=32&_fields=title,link&orderby=date&order=desc', 'advads_support_getting_started_links' );

?>
<div class="advads-card flex flex-col">
	<div>
		<div class="header-icon">
			<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
				<path d="M12 7C12 5.93913 11.5786 4.92172 10.8284 4.17157C10.0783 3.42143 9.06087 3 8 3H2V18H9C9.79565 18 10.5587 18.3161 11.1213 18.8787C11.6839 19.4413 12 20.2044 12 21M12 7V21M12 7C12 5.93913 12.4214 4.92172 13.1716 4.17157C13.9217 3.42143 14.9391 3 16 3H22V18H15C14.2044 18 13.4413 18.3161 12.8787 18.8787C12.3161 19.4413 12 20.2044 12 21" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"/>
			</svg>
		</div>
		<h3><?php esc_html_e( 'Getting started', 'advanced-ads' ); ?></h3>
		<?php if ( ! empty( $items ) ) : ?>
		<ul>
			<?php foreach ( $items as $item ) : ?>
			<li>
				<a href="<?php echo esc_url( $item['link'] ); ?>?utm_source=advanced-ads&utm_medium=link&utm_campaign=plugin_support_getting_started" target="_blank" rel="noopener noreferrer">
					<?php echo esc_html( $item['title']['rendered'] ); ?>
				</a>
			</li>
			<?php endforeach; ?>
		</ul>
		<?php else : ?>
			<?php include 'error.php'; ?>
		<?php endif; ?>
	</div>

	<footer class="mt-auto">
		<a class="advads-view-all-link" href="https://wpadvancedads.com/manual/?utm_source=advanced-ads&utm_medium=link&utm_campaign=plugin_support_getting_started_view_all" target="_blank" rel="noopener noreferrer">
			<?php esc_html_e( 'View all articles', 'advanced-ads' ); ?>
			<?php include 'arrow.php'; ?>
		</a>
	</footer>
</div>
