<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Current Consumption</div> <?php endif; ?>
<?php if ($point->lastChildReview): ?>
    <?php $parsedReview = json_decode($point->lastChildReview->data); ?>
    <div class="<?= !@$flat && $point->last_child_review_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
        <?php if(@$parsedReview->mealsPerWeek): ?>
        <div class="inline-html-container text-dark"><span class="text-sm">Meals per week:</span> <?= @$parsedReview->mealsPerWeek ? strip_tags($parsedReview->mealsPerWeek) : '' ?></div>
        <?php endif; ?>
        <?php if(@$parsedReview->selfPrepMealsPerWeek): ?>
        <div class="inline-html-container text-dark"><span class="text-sm">Self-prepared meals per week:</span> <?= @$parsedReview->selfPrepMealsPerWeek ? strip_tags($parsedReview->selfPrepMealsPerWeek) : '' ?></div>
        <?php endif; ?>
        <span class="screen-only">
        <?php if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id): ?>
            <span class="text-sm">(updated on the patient's chart)</span>
        <?php else: ?>
            <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
                <span class="text-sm">(updated on this note)</span>
            <?php else: ?>
                <div class="d-inline position-relative on-click-menu">
                    <span class="text-sm text-primary c-pointer">
                        <?= relative_friendly_date($point->last_child_review_effective_date) ?>
                        <?php if($point->lastChildReview->creatorPro): ?>
                            by <?= $point->lastChildReview->creatorPro->displayName() ?>
                        <?php endif; ?>
                    </span>
                    <div menu right class="bg-white border">
                        <a native target="_blank"
                           href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>"
                           class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
                    </div>
                </div>
            <?php endif; ?>
        <?php endif; ?>
        </span>
    </div>
<?php else: ?>
    <span class="text-secondary text-sm">-</span>
<?php endif; ?>
