<?php
/**
 * Connection status bar partial.
 *
 * @package    100Prints
 */

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

$conn_service = new Hundred_Prints_Connection_Service();
$is_connected = $conn_service->is_connected();
$workspace_info = $conn_service->get_workspace_info();
?>

<div class="hundredp-status-bar">
	<?php if ( $is_connected && $workspace_info ) : ?>
		<span class="hundredp-status-dot is-connected"></span>
		<span>Connected to <strong><?php echo esc_html( $workspace_info['workspace_name'] ); ?></strong> (<?php echo esc_html( ucfirst( $workspace_info['plan_tier'] ) ); ?>)</span>
	<?php else : ?>
		<span class="hundredp-status-dot is-free"></span>
		<span>Running in Free Mode. <a href="<?php echo esc_url( admin_url( 'admin.php?page=100prints-connections' ) ); ?>">Connect Account</a></span>
	<?php endif; ?>
</div>
