<?php

$contentData = [
    "items" => []
];
if($patient->canvas_data) {
    $canvasData = json_decode($patient->canvas_data, true);
    if(isset($canvasData["care-team"])) {
        $contentData = $canvasData["care-team"];
    }
}

if(count($contentData['items'])) {
    for ($i = 0; $i < count($contentData['items']); $i++) {
        $item = $contentData['items'][$i];
?>
        <div class="mb-2">
            <div class="content-html text-nowrap">
                <b><?= $item["name"] ?></b>
                <?php if(!!$item["specialty"]): ?>
                <span class="text-secondary mx-1">/</span>
                <span class="text-secondary"><?= $item["specialty"] ?></span>
                <?php endif; ?>
            </div>
        </div>
<?php
    }
}
else {
    ?>
    <div class="text-secondary">Nothing here yet!</div>
    <?php
}
?>
