<?php
defined( 'ABSPATH' ) || exit;
?>
<div class="cwpm-logs-view__topbar">

	<h4 class="cwpm-logs-view__title">
		<span class="icon icon--xs" aria-hidden="true"><i class="fa-solid fa-file-lines"></i></span>
		<?php esc_html_e( 'Logs', 'coffeewp-media-cleanup' ); ?>
	</h4>
</div>

<div class="cwpm-stats-grid cwpm-logs-view__stats">
	<div class="cwpm-stat-card">
		<span class="cwpm-stat-card__icon icon text-info" aria-hidden="true"><i
				class="fa-solid fa-file-lines"></i></span>
		<div class="cwpm-stat-card__body">
			<span class="cwpm-stat-card__value" id="cwpm-logs-count">—</span>
			<span class="cwpm-stat-card__label"><?php esc_html_e( 'Log Files', 'coffeewp-media-cleanup' ); ?></span>
		</div>
	</div>
	<div class="cwpm-stat-card">
		<span class="cwpm-stat-card__icon icon" aria-hidden="true"><i class="fa-solid fa-hard-drive"></i></span>
		<div class="cwpm-stat-card__body">
			<span class="cwpm-stat-card__value" id="cwpm-logs-size">—</span>
			<span class="cwpm-stat-card__label"><?php esc_html_e( 'Total Size', 'coffeewp-media-cleanup' ); ?></span>
		</div>
	</div>
</div>

<div class="cwpm-logs-view__auto-delete">
	<label class="switch"
		title="<?php esc_attr_e( 'Automatically delete log files older than 30 days', 'coffeewp-media-cleanup' ); ?>">
		<input type="checkbox" class="switch__input" id="cwpm-logs-auto-delete" name="auto_delete_logs" value="1" <?php checked( get_option( 'cwpm_auto_delete_logs', false ), true ); ?> />
		<span class="switch__track" aria-hidden="true"></span>
	</label>
	<span
		class="cwpm-logs-view__auto-delete-label"><?php esc_html_e( 'Auto-delete after 30 days', 'coffeewp-media-cleanup' ); ?></span>
</div>

<div id="cwpm-logs-empty-state" class="cwpm-logs-view__empty-state" style="display: none;">
	<span class="icon icon--xl text-muted" aria-hidden="true"><i class="fa-solid fa-file-circle-xmark"></i></span>
	<p><?php esc_html_e( 'No log files yet. Logs are created when you run scans or clean actions.', 'coffeewp-media-cleanup' ); ?>
	</p>
</div>

<div class="cwpm-table-scroll">
	<table class="table table--heading-secondary cwpm-file-table" id="cwpm-logs-table">
		<thead>
			<tr>
				<th class="th-file"><?php esc_html_e( 'Date', 'coffeewp-media-cleanup' ); ?></th>
				<th><?php esc_html_e( 'File', 'coffeewp-media-cleanup' ); ?></th>
				<th><?php esc_html_e( 'Size', 'coffeewp-media-cleanup' ); ?></th>
				<th class="th-action"><?php esc_html_e( 'Actions', 'coffeewp-media-cleanup' ); ?></th>
			</tr>
		</thead>
		<tbody id="cwpm-logs-tbody"></tbody>
	</table>
</div>
