<?php

use App\Models\Point;

/** @var \App\Models\Client $patient */

$points = Point::getPointsOfCategory($patient, 'MEDICATION');
$tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
?>

<?php if($tracker && @($tracker->data->no_known_medications)): ?>
    <div class="text-secondary"><span>No active medications</span></div>
<?php endif; ?>
<?php if(!$tracker || !@($tracker->data->no_known_medications)): ?>
	<?php if (!count($points)): ?>
		<div class="text-secondary">-</div>
	<?php else: ?>
		<div class="d-flex align-items-baseline flex-wrap">
			<?php $j = 0; foreach ($points as $point): $j++; ?>
				<span class="mr-2 text-nowrap">• <?= !!@($point->data->name) ? @($point->data->name) : '-' ?></span>
			<?php endforeach; ?>
		</div>
	<?php endif; ?>
<?php endif; ?>
