<?php
    $row = $_view["interview"];
    $active = $_view["active"] ?? false;
    $status = [
        "PUBLISHED" => "veröffentlicht",
        "REVIEW" => "in Prüfung"
    ];
?>

<?php if ($active) { ?>
<div class="score-box space-mt-sm bg-lightgreen">
<?php } else { ?>
<div class="score-box space-mt-sm">
<?php } ?>
    <div class="row space-mb-xs">
        <div class="col-sm-6">
<?php if ($active) { ?>
            <p class="article-tag bg-darkgreen"><?= $status[$row->status] ?? $row->status; ?></p>
<?php } else { ?>
            <p class="article-tag bg-darkgray"><?= $status[$row->status] ?? $row->status; ?></p>
<?php } ?>
        </div>
        <div class="col-sm-6">
            <div class="text-start text-sm-end">Interview vom <?= date("d.m.Y", $row->timeCreated); ?></div>
        </div>
    </div>
    <div class="row g-3 g-lg-5">
        <div class="col-12 col-sm d-flex">
            <div class="align-self-center">
                <p class="headline big"><?= formatNumber($row->scoreTotal); ?></p>
            </div>
        </div>
        <div class="col-auto d-flex">
            <div class="align-self-center">
                <p class="txt-small interview-score mb-0">Environment</p>
                <p class="txt-big mb-0"><b><?= formatNumber($row->scoreEnvironment); ?></b></p>
            </div>
        </div>
        <div class="col-auto d-flex">
            <div class="align-self-center">
                <p class="txt-small interview-score mb-0">Social</p>
                <p class="txt-big mb-0"><b><?= formatNumber($row->scoreSocial); ?></b></p>
            </div>
        </div>
        <div class="col-auto d-flex">
            <div class="align-self-center">
                <p class="txt-small interview-score mb-0">Governance</p>
                <p class="txt-big mb-0"><b><?= formatNumber($row->scoreGovernance); ?></b></p>
            </div>
        </div>
        <div class="col-12 col-lg">
            <div class="row g-2">
                <div class="col-12">
                    <div class="align-self-center w-100">
                        <a href="<?= $_con->getLink(["interview", "overview", $row->key]); ?>" class="btn sm btn-secondary ico right w-100">
                            Details ansehen<span class="icon"></span>
                        </a>
                    </div>
                </div>
                <?php if ($active) { ?>
                <div class="col-12">
                    <div class="align-self-center w-100">
                        <a href="<?= $_con->getLink(["company", "documents"]); ?>" class="btn sm btn-secondary ico right w-100">
                            Dokumente<span class="icon"></span>
                        </a>
                    </div>
                </div>
                <?php } ?>
            </div>
        </div>
    </div>
</div>