<?php

use App\Models\Point;

$category = 'COVID_FOLLOW-UP';

$point = Point::getOnlyTopLevelPointOfCategory($note, 'COVID_FOLLOW-UP', true);

if($point) {
    ?> <div class="popup-content-container px-3"> <?php
    foreach ($point->childReviews as $childReview) {
        $contentData = $parsed = false;
        if ($childReview->data) {
            $childReview->data = json_decode($childReview->data, true);
            $contentData = $parsed = $childReview->data;
            ?>
            <div class="mb-1 font-weight-bold">{{$childReview->creatorPro->displayName()}} - {{friendly_date($childReview->note->effective_dateest)}}</div>
            <div class="pl-3 bg-light border p-3 mb-3">
            <?php
            foreach ($contentData as $key => $value) {
                if(!!$value) {
                    ?>
                    <div><span class="text-secondary mr-2">{{ucwords(str_replace('_', ' ', substr($key, 4)))}}:</span><?= $value ?></div>
                    <?php
                }
            }
            ?> </div> <?php
        }
    }
    ?> </div> <?php
}
?>
