<?php
/**
 * Workspace portal hero — matches Nexus Enterprise portal style.
 *
 * Expected variables:
 *   $workspaceCrumbPill   string  e.g. "HRM"
 *   $workspaceCrumbCurrent string e.g. "Employees"
 *   $workspaceTitle       string
 *   $workspaceDesc        string
 *   $workspaceAction      ?array{href: string, label: string, icon?: string}
 */
$workspaceCrumbPill    = $workspaceCrumbPill ?? 'Workspace';
$workspaceCrumbCurrent = $workspaceCrumbCurrent ?? '';
$workspaceTitle        = $workspaceTitle ?? '';
$workspaceDesc         = $workspaceDesc ?? '';
$action                = $workspaceAction ?? null;
?>
<section class="enterprise-workspace-hero enterprise-workspace-hero--split">
    <div class="enterprise-workspace-hero__main">
        <div class="enterprise-workspace-crumb">
            <span class="enterprise-crumb-pill"><?= esc($workspaceCrumbPill) ?></span>
            <span class="enterprise-crumb-sep">/</span>
            <span class="enterprise-crumb-current"><?= esc($workspaceCrumbCurrent) ?></span>
        </div>
        <h1 class="enterprise-workspace-title"><?= esc($workspaceTitle) ?></h1>
        <p class="enterprise-workspace-desc"><?= esc($workspaceDesc) ?></p>
    </div>
    <?php if ($action): ?>
        <div class="enterprise-workspace-hero__actions">
            <a href="<?= esc($action['href']) ?>" class="btn btn-primary enterprise-workspace-cta">
                <?php if (! empty($action['icon'])): ?>
                    <i class="<?= esc($action['icon']) ?> me-1"></i>
                <?php else: ?>
                    <i class="fa-solid fa-plus me-1"></i>
                <?php endif; ?>
                <?= esc($action['label']) ?>
            </a>
        </div>
    <?php endif; ?>
</section>
