<?php
/**
 * Post Table Markup
 *
 * Contains the frontend HTML structure for rendering the post table in Author Kit admin pages.
 *
 * @package Author_Kit
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require AUTHOR_KIT_PLUGIN_PATH . 'admin/views/author-kit-admin-header.php';

?>
<div class="main-content" id="author-kit-post-table">

	<!-- btn and others -->
	<div id="btn-add-new">
		<button><?php esc_html_e( 'Add New Post', 'author-kit' ); ?></button>
		<div id="right-container">
			<div id="multi-select-options">

				<div id="container-for-multi-options">
					<span><?php esc_html_e( 'Bulk Action:', 'author-kit' ); ?></span>

					<div class="icon-bar">
						<a href="#" id="trash-all-posts" class="action-icon" data-tooltip="<?php echo esc_attr__( 'Move all posts to Trash', 'author-kit' ); ?>">
							<span class="icon-circle">
								<i class="fa-solid fa-trash-can-arrow-up"></i>
							</span>
							<?php esc_html_e( 'Trash', 'author-kit' ); ?>
						</a>

						<a href="#" id="restore-all-posts" class="action-icon" data-tooltip="<?php echo esc_attr__( 'Restore all posts', 'author-kit' ); ?>">
							<span class="icon-circle">
								<i class="fa-solid fa-rotate-left"></i>
							</span>
							<?php esc_html_e( 'Restore', 'author-kit' ); ?>
						</a>

						<a href="#" id="delete-all-posts" class="action-icon" data-tooltip="<?php echo esc_attr__( 'Permanently delete all posts', 'author-kit' ); ?>">
							<span class="icon-circle danger">
								<i class="fa-solid fa-xmark"></i>
							</span>
							<?php esc_html_e( 'Delete', 'author-kit' ); ?>
						</a>
					</div>
				</div>


			</div>

			<div class="search-bar">
				<i class="fas fa-search"></i>
				<input type="text" placeholder="<?php esc_html_e( 'Search by Post Title', 'author-kit' ); ?>" id="post-search">
			</div>
		</div>
	</div>


	<!-- Table data admin ,user etc  -->
	<div id="data-table-authorwp">
		<div id="filter-tabs">
			<p id="all-posts" onclick=""><?php esc_html_e( 'All ', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="published-posts"><?php esc_html_e( 'Published ', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="draft-posts"><?php esc_html_e( 'Draft ', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="future-posts"><?php esc_html_e( 'Scheduled ', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="pending-posts"><?php esc_html_e( 'Pending ', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="private-posts"><?php esc_html_e( 'Private ', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="mine-posts"><?php esc_html_e( 'Mine', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="trash-posts"><?php esc_html_e( 'Trash', 'author-kit' ); ?> </p> <span id="information"></span>
			<p id="guest-posts"><?php esc_html_e( 'Guest Post ', 'author-kit' ); ?></p> <span id="information"></span>
		</div>



	</div>


	<div class="contributors-card" id="contributors-card" style="display: none;">
		<div id="header-info-card">
			<h3><?php esc_html_e( 'People Contributed to This Post', 'author-kit' ); ?></h3>
			<span class="close-btn" id="close-btn" onclick=""><i class="fa-solid fa-xmark"></i></span>
		</div>
		<div class="contributors-list" id="contributors-list">
			<!-- Contributors will be injected here via JS -->
		</div>
	</div>




	<div class="table-container">
		<table id="postTable">
			<thead current-page-id="">
				<tr>
					<th><input type="checkbox" id="select-all" class="select-all-checkbox" /></th>

					<th data-column="title" class="sortable">
						<?php esc_html_e( 'POST', 'author-kit' ); ?>
						<span class="sort-icons">
							<i class="sort-icon asc">&#9650;</i>
							<i class="sort-icon desc">&#9660;</i>
						</span>
					</th>

					<th><?php esc_html_e( 'AUTHOR', 'author-kit' ); ?></th>
					<th><?php esc_html_e( 'STATUS', 'author-kit' ); ?></th>

					<th data-column="date" class="sortable">
						<?php esc_html_e( 'DATE', 'author-kit' ); ?>
						<span class="sort-icons">
							<i class="sort-icon asc">&#9650;</i>
							<i class="sort-icon desc">&#9660;</i>
						</span>
					</th>

					<th><?php esc_html_e( 'ACTIONS', 'author-kit' ); ?></th>
				</tr>
			</thead>
			<tbody>
				<!-- Data will be injected here by JavaScript -->


			</tbody>

		</table>
		<!-- Place this loader html in this location after table tag close Necessary -->
		<div id="loader" style="display: none;">
			<div>
				<div class="author-kit-loader"></div>
			</div>
		</div>


		<div id="pagination">
			<section id="pagination-footer"> <?php esc_html_e( 'Posts Per Page: ', 'author-kit' ); ?>
				<select id="rowsPerPage" post-data-category="">
					<option value="5">5</option>
					<option selected value="10">10</option>
					<option value="25">25</option>
					<option value="50">50</option>
					<option value="75">75</option>
					<option value="100">100</option>
					<option value="-1">All</option>
				</select>
				<span id="paginationControls">
					<button id="prevPage" prev-page-id="1" post-data-category=""><?php esc_html_e( 'Previous', 'author-kit' ); ?></button>
					<span id="pageNumbers"></span>
					<button id="nextPage" next-page-id="2" post-data-category=""><?php esc_html_e( 'Next', 'author-kit' ); ?></button>
				</span>
				<span id="pageInfo"></span>

			</section>
		</div>


	</div>
</div>
