<?php
// components/Audience/WizardSteps.php
namespace Components\Audience;

class WizardSteps
{
    public const STEP_BASE_DATA = 'base_data';
    public const STEP_CONFIRMATION = 'confirmation';

    /**
     * Get the wizard steps for audience creation.
     *
     * @return array
     */
    public static function getSteps(): array
    {
        $lang = (string)\mh_session('language', 'english');
        $isGerman = ($lang === 'german' || $lang === 'de');

        return [
            [
                'id' => self::STEP_BASE_DATA,
                'label' => (string) \mh_lng('UI_AUDIENCE_STEP_BASE_DATA', $isGerman ? 'Zielgruppen-Details' : 'Audience Details'),
                'description' => (string) \mh_lng('UI_AUDIENCE_STEP_BASE_DATA_DESC', $isGerman ? 'Name, Nutzung und Quelle festlegen' : 'Name, usage and source'),
            ],
            [
                'id' => self::STEP_CONFIRMATION,
                'label' => (string) \mh_lng('UI_AUDIENCE_STEP_CONFIRMATION', $isGerman ? 'Alles bereit!' : 'All set!'),
                'description' => (string) \mh_lng('UI_AUDIENCE_STEP_CONFIRMATION_DESC', $isGerman ? 'Zielgruppe verfeinern oder abschließen' : 'Refine your audience or finish'),
            ],
        ];
    }

    /**
     * Render the Stepper component for the current wizard state.
     *
     * @param string $currentStepId
     * @return string
     */
    public static function renderStepper(string $currentStepId): string
    {
        $steps = self::getSteps();
        $stepper = \Components\Ui\Stepper::render($steps, $currentStepId);
        return '<div class="absolute z-100 w-full px-6 py-4 border-b border-zinc-200 bg-zinc-50/80 -m-6 ">' . $stepper . '</div><div class="h-18"></div>';
    }
}
