<?php
/**
 * Scripts and styles.
 *
 * @package ttsunsolar
 */

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

/**
 * Front-end assets.
 */
function ttsunsolar_enqueue_assets() {
	wp_enqueue_style(
		'ttsunsolar-fontawesome',
		TTSUNSOLAR_URI . '/solarkit/css/fontawesome-6-all.min.css',
		array(),
		TTSUNSOLAR_VERSION
	);

	wp_enqueue_style(
		'ttsunsolar-theme',
		TTSUNSOLAR_URI . '/solarkit/css/solarkit-theme.css',
		array( 'ttsunsolar-fontawesome' ),
		TTSUNSOLAR_VERSION
	);

	wp_enqueue_style(
		'ttsunsolar-style',
		get_stylesheet_uri(),
		array( 'ttsunsolar-theme' ),
		TTSUNSOLAR_VERSION
	);

	wp_enqueue_script(
		'ttsunsolar-theme',
		TTSUNSOLAR_URI . '/solarkit/js/solarkit-theme.js',
		array(),
		TTSUNSOLAR_VERSION,
		true
	);

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'ttsunsolar_enqueue_assets' );
