<?php
/**
 * Main segments page template
 *
 * @link       https://personalizewp.com/
 * @since      3.2.0 Merged into PWP
 * @since      1.0.0
 *
 * @package    PersonalizeWP
 * @subpackage PersonalizeWP/Admin
 */

namespace PersonalizeWP\Admin;

use PersonalizeWP\Admin\PageSegments;
use PersonalizeWP\Admin\ListTableSegments;

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

?>
	<main>
		<nav class="header-nav">
			<ul class="nav-list">
				<li>
					<a class="nav-link is-active" href="<?php esc_url( admin_url( PageSegments::$index_url ) ); ?>"><?php esc_html_e( 'Segments', 'personalizewp' ); ?></a>
				</li>
			</ul>
		</nav>

		<?php
		$segments = new ListTableSegments();
		$segments->prepare_items();
		?>
		<form id="segments-filter" method="get">
			<div class="with-sidebar segments" data-direction="rtl">
				<div class="section-description">
					<p><?php esc_html_e( 'Enhance engagement with your most valuable prospects by easily grouping your website visitors based on their activities and needs. Segmenting your audiences is the perfect way to deliver unique user experiences, boost your conversion rates, strengthen your customer relationships, and enhance customer retention.', 'personalizewp' ); ?></p>
				</div>
				<div class="sidebar table-actions">
					<a class="primary btn create" href="<?php echo esc_url( PageSegments::$create_url ); ?>"><?php esc_html_e( 'Create Segment', 'personalizewp' ); ?></a>
					<?php
					$segments->search_box( __( 'Search Segments', 'personalizewp' ), 'search-segments' );
					?>
				</div>
			</div>

			<?php
			$segments->display();
			?>
		</form>
	</main>

<?php
require_once __DIR__ . '/_modal-deactivate.php';
require_once __DIR__ . '/_modal-delete.php';
