<?php
/**
 * Carte plugin installé — vue d'ensemble.
 *
 * @package Volade\SDK
 * @license GPL-2.0-or-later
 * @var string $slug
 * @var array<string, mixed> $plugin
 */

defined( 'ABSPATH' ) || exit;

$icon     = $plugin['icon'] ?? '⚡';
$name     = $plugin['name'] ?? ( $plugin['menu_title'] ?? '' );
$blurb    = $plugin['blurb'] ?? '';
$tier     = $plugin['tier'] ?? 'free';
$url      = $plugin['settings_url'] ?? '';
$cat_icon = $plugin['category_icon'] ?? '📦';
$cat_lbl  = $plugin['category_label'] ?? '';
?>
<a class="volade-hub-card" href="<?php echo esc_url( $url ); ?>">
	<div class="volade-hub-card-glow" aria-hidden="true"></div>
	<div class="volade-hub-card-top">
		<div class="volade-hub-card-icon"><?php echo esc_html( $icon ); ?></div>
		<span class="volade-discover-badge volade-discover-badge--installed"><?php esc_html_e( 'Actif', 'core-version-switcher-by-volade' ); ?></span>
	</div>
	<h3 class="volade-hub-card-title"><?php echo esc_html( $name ); ?></h3>
	<?php if ( $blurb ) : ?>
		<p class="volade-hub-card-blurb"><?php echo esc_html( $blurb ); ?></p>
	<?php endif; ?>
	<div class="volade-hub-card-meta">
		<span class="volade-discover-tag">
			<span aria-hidden="true"><?php echo esc_html( $cat_icon ); ?></span>
			<?php echo esc_html( $cat_lbl ); ?>
		</span>
		<span class="volade-discover-tier volade-discover-tier--<?php echo esc_attr( $tier ); ?>">
			<?php echo esc_html( $plugin['tier_label'] ?? '' ); ?>
		</span>
	</div>
	<span class="volade-btn volade-btn-sm volade-btn-primary volade-hub-card-cta">
		<?php esc_html_e( 'Ouvrir les réglages', 'core-version-switcher-by-volade' ); ?> →
	</span>
</a>
