<?php
/**
 * Example usage of the Aysa Credits Component
 * 
 * This file demonstrates how to include and use the credits component in any template.
 */

// If this file is called directly, abort.
if (!defined('WPINC')) {
    die;
}

/**
 * Example 1: Using the static display method (simplest approach)
 */
?>
<div class="my-custom-template">
    <h2>My Custom Template</h2>
    
    <div class="credits-display">
        <?php Aysa_Credits_Component::display(); ?>
    </div>
    
    <!-- Rest of your template content -->
</div>

<?php
/**
 * Example 2: Creating a new instance with a specific user ID
 */
?>
<div class="another-template">
    <h2>Another Template</h2>
    
    <div class="credits-display">
        <?php
        $credits_component = new Aysa_Credits_Component(0); // Use 0 for demo mode or actual user ID
        echo $credits_component->render();
        ?>
    </div>
    
    <!-- Rest of your template content -->
</div>

<?php
/**
 * Example 3: Using the global admin instance
 */
?>
<div class="third-template">
    <h2>Third Template</h2>
    
    <div class="credits-display">
        <?php
        global $aysa_admin;
        if (isset($aysa_admin) && property_exists($aysa_admin, 'credits_component')) {
            echo $aysa_admin->credits_component->render();
        }
        ?>
    </div>
    
    <!-- Rest of your template content -->
</div>

<?php
/**
 * Example 4: Using the component in different contexts
 */
?>
<!-- In the page title -->
<div class="page-title">
    <h1>Page Title</h1>
    <div class="right-side">
        <?php Aysa_Credits_Component::display(); ?>
    </div>
</div>

<!-- In a sidebar widget -->
<div class="sidebar-widget">
    <h3>Your Account</h3>
    <?php Aysa_Credits_Component::display(); ?>
    <p>Other widget content...</p>
</div>

<!-- In a dashboard panel -->
<div class="dashboard-panel">
    <div class="panel-header">
        <h3>SEO Performance</h3>
        <?php Aysa_Credits_Component::display(); ?>
    </div>
    <div class="panel-content">
        <!-- Panel content -->
    </div>
</div> 