<?php
/**
 * Help Panel.
 *
 * @package prime_charity_trust
 */

// Check demo import status
$prime_charity_trust_import_done = get_option( 'prime_charity_trust_demo_import_done' );

// Button text
$prime_charity_trust_button_text = $prime_charity_trust_import_done
    ? __( 'View Site', 'prime-charity-trust' )
    : __( 'Start Demo Import', 'prime-charity-trust' );

// Button link
if ( $prime_charity_trust_import_done ) {

    $prime_charity_trust_button_link = home_url( '/' );

} else {

    $theme = wp_get_theme();
    $current_theme = $theme->get( 'Name' );

    if ( $current_theme === 'Prime Charity Trust' ) {

        $prime_charity_trust_button_link = admin_url( 'themes.php?page=primecharitytrust-wizard' );

    } elseif ( $current_theme === 'Charity Funds' ) {

        $prime_charity_trust_button_link = admin_url( 'themes.php?page=charityfunds-wizard' );

    } elseif ( $current_theme === 'Prime Fundraiser' ) {

        $prime_charity_trust_button_link = admin_url( 'themes.php?page=primefundraiser-wizard' );

    } else {

        $prime_charity_trust_button_link = admin_url( 'themes.php' );
    }
}
?>

<div id="help-panel" class="panel-left visible">
    <div class="panel-aside active">
        <div class="demo-content">
            <div class="demo-info">
                <h4><?php esc_html_e( 'DEMO CONTENT IMPORTER', 'prime-charity-trust' ); ?></h4>

                <p>
                    <?php esc_html_e(
                        'The Demo Content Importer helps you quickly set up your website to look exactly like the theme demo. Instead of building pages from scratch, you can import pre-designed layouts, pages, menus, images, and basic settings in just a few clicks.',
                        'prime-charity-trust'
                    ); ?>
                </p>

                <a class="button button-primary first-color"
                   style="text-transform: capitalize"
                   href="<?php echo esc_url( $prime_charity_trust_button_link ); ?>"
                   title="<?php echo esc_attr( $prime_charity_trust_button_text ); ?>"
                   <?php echo $prime_charity_trust_import_done ? 'target="_blank"' : ''; ?>>
                    <?php echo esc_html( $prime_charity_trust_button_text ); ?>
                </a>
            </div>

            <div class="demo-img">
                <img src="<?php echo esc_url( get_stylesheet_directory_uri() . '/screenshot.png' ); ?>"
                     alt="<?php esc_attr_e( 'Theme Screenshot', 'prime-charity-trust' ); ?>" />
            </div>
        </div>
    </div>

    <div class="panel-aside" >
        <h4><?php esc_html_e( 'USEFUL LINKS', 'prime-charity-trust' ); ?></h4>
        <p><?php esc_html_e( 'Find everything you need to set up, customize, and manage your website with ease. These helpful resources are designed to guide you at every step, from installation to advanced customization.', 'prime-charity-trust' ); ?></p>
        <div class="useful-links">
            <a class="button button-primary second-color" href="<?php echo esc_url( PRIME_CHARITY_TRUST_DEMO_URL ); ?>" title="<?php esc_attr_e( 'Live Demo', 'prime-charity-trust' ); ?>" target="_blank">
                <?php esc_html_e( 'Live Demo', 'prime-charity-trust' ); ?>
            </a>
            <a class="button button-primary first-color" href="<?php echo esc_url( PRIME_CHARITY_TRUST_FREE_DOC_URL ); ?>" title="<?php esc_attr_e( 'Documentation', 'prime-charity-trust' ); ?>" target="_blank">
                <?php esc_html_e( 'Documentation', 'prime-charity-trust' ); ?>
            </a>
            <a class="button button-primary second-color" href="<?php echo esc_url( PRIME_CHARITY_TRUST_URL ); ?>" title="<?php esc_attr_e( 'Get Premium', 'prime-charity-trust' ); ?>" target="_blank">
                <?php esc_html_e( 'Get Premium', 'prime-charity-trust' ); ?>
            </a>
            <a class="button button-primary first-color" href="<?php echo esc_url( PRIME_CHARITY_TRUST_BUNDLE_URL ); ?>" title="<?php esc_attr_e( 'Get Bundle - 60+ Themes', 'prime-charity-trust' ); ?>" target="_blank">
                <?php esc_html_e( 'Get Bundle - 60+ Themes', 'prime-charity-trust' ); ?>
            </a>
        </div>
    </div>

    <div class="panel-aside" >
        <h4><?php esc_html_e( 'REVIEW', 'prime-charity-trust' ); ?></h4>
        <p><?php esc_html_e( 'If you have a moment, please consider leaving a rating and short review. It only takes a minute, and your support means a lot to us.', 'prime-charity-trust' ); ?></p>
        <a class="button button-primary first-color" href="<?php echo esc_url( PRIME_CHARITY_TRUST_REVIEW_URL ); ?>" title="<?php esc_attr_e( 'Visit the Review', 'prime-charity-trust' ); ?>" target="_blank">
            <?php esc_html_e( 'Leave a Review', 'prime-charity-trust' ); ?>
        </a>
    </div>
    
    <div class="panel-aside">
        <h4><?php esc_html_e( 'CONTACT SUPPORT', 'prime-charity-trust' ); ?></h4>
        <p>
            <?php esc_html_e( 'Thank you for choosing Prime Charity Trust! We appreciate your interest in our theme and are here to assist you with any support you may need.', 'prime-charity-trust' ); ?></p>
        <a class="button button-primary first-color" href="<?php echo esc_url( PRIME_CHARITY_TRUST_SUPPORT_URL ); ?>" title="<?php esc_attr_e( 'Visit the Support', 'prime-charity-trust' ); ?>" target="_blank">
            <?php esc_html_e( 'Contact Support', 'prime-charity-trust' ); ?>
        </a>
    </div>
</div>