<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
/** @var string $pickup_point_kind */
$pickup_point_kind = isset( $args['pickup_point_kind'] ) ? (string) $args['pickup_point_kind'] : '';
/** @var string $img_url */
$img_url           = simplyin()->get_plugin_url() . 'public/img/';

if ( 'parcel_machine' === $pickup_point_kind ) {
	/** @var string $header_title */
	$header_title     = __( 'Add a parcel locker', 'simplyin' );
	/** @var string $empty_list_text */
	$empty_list_text  = __( 'No parcel lockers found near the provided address', 'simplyin' );
} elseif ( 'service_point' === $pickup_point_kind ) {
	/** @var string $header_title */
	$header_title     = __( 'Add a pickup point', 'simplyin' );
	/** @var string $empty_list_text */
	$empty_list_text  = __( 'No pickup points found near the provided address', 'simplyin' );
} else {
	/** @var string $header_title */
	$header_title     = __( 'Add a parcel locker or pickup point', 'simplyin' );
	/** @var string $empty_list_text */
	$empty_list_text  = __( 'No locations found near the provided address', 'simplyin' );
}

/** @var string $root_data_kind */
$root_data_kind = '' !== $pickup_point_kind ? $pickup_point_kind : '';
?>
<div class="simplyin-popup-overlay"></div>
<div class="simplyin-popup simplyin-autocomplete"<?php echo '' !== $root_data_kind ? ' data-pickup-point-kind="' . esc_attr( $root_data_kind ) . '"' : ''; ?>>
	<div class="simplyin-popup-header">
    <img width="32" height="32"
         src="<?php echo esc_url( $img_url . 'logo_smalln.svg' ); ?>" alt="<?php esc_attr_e( 'Simply.IN', 'simplyin' ); ?>"/>
		<div
		class="popup-add-address-label-header"><?php echo esc_html( $header_title ); ?></div>
		<div class="simplyin-popup-close-button">
			<img width="20" height="21"
				 src="<?php echo esc_url( $img_url . 'close_icon.svg' ); ?>"/>
		</div>
	</div>
	<div class="simplyin-popup-container simplyin-autocomplete">
		<div class="simplyin-popup-content">
			<div class="form-group">
				<input type="text" id="pickup-search" placeholder="<?php esc_attr_e( 'Search',
						'simplyin' ); ?>" autocomplete="off">
			</div>
			<div class="pickup-placeholder">
				<img
					src="<?php echo esc_url( $img_url . 'point.svg' ); ?>"
					alt="" width="112" height="112">
				<div><?php echo esc_html( $empty_list_text ); ?></div>
			</div>
			<div class="pickup-list-container" style="display: none"></div>
			<div class="pickup-details-selected">
				<div class="pickup-details-header mb-half"><?php esc_html_e( 'Address details',
						'simplyin' ); ?></div>
				<div><?php esc_html_e( 'Number:', 'simplyin' ); ?> <span
						id="simplyin-pickup-number"></span></div>
				<div><?php esc_html_e( 'Address:', 'simplyin' ); ?> <span
						id="simplyin-pickup-address"></span></div>
				<div><?php esc_html_e( 'Additional information:',
						'simplyin' ); ?> <span id="simplyin-pickup-info"></span>
				</div>
			</div>
			<div class="pickup-details-header"><?php esc_html_e( 'Address name',
						'simplyin' ); ?></div>
			<div class="pickup-details-description"><?php esc_html_e( 'A personalised name will help you find or associate the address on your list more quickly.',
					'simplyin' ); ?></div>
			<div class="form-group">
				<input type="text" id="pickup-name" placeholder="<?php esc_attr_e( 'Enter name',
						'simplyin' ); ?>">
			</div>
		</div>
		<div class="popup-buttons-footer">
			<button type="button"
					class="popup-button simplyin-cancel"><?php esc_html_e( 'Cancel',
					'simplyin' ); ?></button>
			<button type="submit"
					class="popup-button simplyin-submit"><?php esc_html_e( 'Add',
					'simplyin' ); ?></button>
		</div>
	</div>
</div>
