<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$onscreen_notification_option = gigneo_option( '_gigneo_ts_notification_onscreen', true );

if ( ! $onscreen_notification_option ) {
	return;
}

$profile_id           = $args['profile_id'] ?? gigneo_active_profile_id();
$platform_type        = gigneo_platform_type();
$notification_order   = gigneo_post_meta( $profile_id, '_gigneo_pm_notification_order' );
$notification_support = gigneo_post_meta( $profile_id, '_gigneo_pm_notification_support' );
$notification_service = gigneo_post_meta( $profile_id, '_gigneo_pm_notification_service' );
$notification_job     = gigneo_post_meta( $profile_id, '_gigneo_pm_notification_job' );
$notification_wallet  = gigneo_post_meta( $profile_id, '_gigneo_pm_notification_wallet' );
$notification_account = gigneo_post_meta( $profile_id, '_gigneo_pm_notification_account' );
?>

<div id="gn-account-notifications" class="gn-dashboard-section gn-account-notifications">
	<div class="gn-head">
		<h3 class="gn-title"><?php esc_html_e( 'Onscreen notifications', 'gigneo' ); ?></h3>
	</div>
	<div class="gn-body">
		<div class="gn-info-inline">
			<div class="gn-info">
				<h4 class="gn-title"><?php esc_html_e( 'Order activity', 'gigneo' ); ?></h4>
				<p class="gn-description"><?php esc_html_e( 'Get notified about activity related to your orders.', 'gigneo' ); ?></p>
			</div>
			<div class="gn-actions">
				<span class="gn-switch">
					<label class="gn-checkbox" for="gn-notification-order">
						<input type="checkbox" id="gn-notification-order" name="order"<?php checked( 'no' !== $notification_order ); ?> value="yes">
					</label>
				</span>
			</div>
		</div>
		<div class="gn-info-inline">
			<div class="gn-info">
				<h4 class="gn-title"><?php esc_html_e( 'Account & security', 'gigneo' ); ?></h4>
				<p class="gn-description"><?php esc_html_e( 'Receive notifications about your account and security updates.', 'gigneo' ); ?></p>
			</div>
			<div class="gn-actions">
				<span class="gn-switch">
					<label class="gn-checkbox" for="gn-notification-account">
						<input type="checkbox" id="gn-notification-account" name="account"<?php checked( 'no' !== $notification_account ); ?> value="yes">
					</label>
				</span>
			</div>
		</div>
		<?php
		if ( 'jobs' !== $platform_type ) {
			?>
		<div class="gn-info-inline">
			<div class="gn-info">
				<h4 class="gn-title"><?php esc_html_e( 'Service activity', 'gigneo' ); ?></h4>
				<p class="gn-description"><?php esc_html_e( 'Get notified about activity related to your services.', 'gigneo' ); ?></p>
			</div>
			<div class="gn-actions">
				<span class="gn-switch">
					<label class="gn-checkbox" for="gn-notification-service">
						<input type="checkbox" id="gn-notification-service" name="service"<?php checked( 'no' !== $notification_service ); ?> value="yes">
					</label>
				</span>
			</div>
		</div>
				<?php
		}
		?>
		<?php
		if ( 'services' !== $platform_type ) {
			?>
		<div class="gn-info-inline">
			<div class="gn-info">
				<h4 class="gn-title"><?php esc_html_e( 'Job activity', 'gigneo' ); ?></h4>
				<p class="gn-description"><?php esc_html_e( 'Get notified about activity related to your jobs.', 'gigneo' ); ?></p>
			</div>
			<div class="gn-actions">
				<span class="gn-switch">
					<label class="gn-checkbox" for="gn-notification-job">
						<input type="checkbox" id="gn-notification-job" name="job" <?php checked( 'no' !== $notification_job, true ); ?> value="yes">
					</label>
				</span>
			</div>
		</div>
		<?php } ?>
		<div class="gn-info-inline">
			<div class="gn-info">
				<h4 class="gn-title"><?php esc_html_e( 'Wallet activity', 'gigneo' ); ?></h4>
				<p class="gn-description"><?php esc_html_e( 'Get notified when wallet transactions occur.', 'gigneo' ); ?></p>
			</div>
			<div class="gn-actions">
				<span class="gn-switch">
					<label class="gn-checkbox" for="gn-notification-wallet">
						<input type="checkbox" id="gn-notification-wallet" name="wallet"<?php checked( 'no' !== $notification_wallet, true ); ?> value="yes">
					</label>
				</span>
			</div>
		</div>
		<?php
		// Support
		do_action( 'gigneo_dashboard_setting_account_notifications_support', $profile_id, $notification_support );
		?>
	</div>
</div>