<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Prevent direct access to the script.
}
$profile_id    = ! empty( $args['profile_id'] ) ? $args['profile_id'] : '';
$profile_type  = ! empty( $args['profile_type'] ) ? $args['profile_type'] : '';
$platform_type = ! empty( $args['platform_type'] ) ? $args['platform_type'] : '';

$profile_reviews = gigneo_profile_rating( $profile_id );
$profile_ratings = gigneo_profile_rating( $profile_id, 'average' );
$success_rate    = gigneo_profile_stat( 'success_rate', $profile_id );
?>
<div id="gn-overview-profile-info" class="gn-dashboard-section gn-overview-profile-info">
	<div class="gn-head">
		<h2 class="gn-title">
			<?php echo esc_html__( 'Profile overview', 'gigneo' ); ?>
		</h2>
		<a href="<?php echo esc_url( gigneo_dashboard_url( 'setting', 'profile' ) ); ?>" class="gn-link gn-link-primary gn-link-sm">
			<?php echo esc_html__( 'Edit profile', 'gigneo' ); ?>
			<i class="hi hi-arrow-up-right" aria-hidden="true"></i>
		</a>
	</div>
	<div class="gn-body">
		<div class="gn-profile-stats">
			<div class="gn-stat">
				<h5 class="gn-value"><?php echo esc_html( $profile_ratings ?? 0 ); ?></h5>
				<p class="gn-label"><?php echo esc_html__( 'Rating', 'gigneo' ); ?></p>
			</div>
			<div class="gn-stat">
				<h5 class="gn-value"><?php echo esc_html( $profile_reviews ?? 0 ); ?></h5>
				<p class="gn-label"><?php echo esc_html__( 'Reviews', 'gigneo' ); ?></p>
			</div>
			<div class="gn-stat">
				<h5 class="gn-value"><?php echo esc_html( $success_rate['lifetime'] ?? 0 ); ?>%</h5>
				<p class="gn-label"><?php echo esc_html__( 'Success rate', 'gigneo' ); ?></p>
			</div>
		</div>
	</div>
</div>
