<div class="wa-message-card-grid">
	<?php if (!empty($record)): foreach ($record as $row):
		$is_active = ($row->active === 'Y');
		$preview = trim(strip_tags((string) $row->deskripsi));
	?>
	<article class="wa-message-card <?=$is_active ? '' : 'inactive';?>">
		<div class="wa-message-card-top"><span class="wa-message-kind">GENERAL</span><span class="wa-message-state <?=$is_active ? '' : 'off';?>"><?=$is_active ? 'AKTIF' : 'TIDAK AKTIF';?></span></div>
		<h2><?=html_escape($row->title);?></h2>
		<pre class="wa-message-preview"><?=html_escape($preview);?></pre>
		<div class="wa-message-card-actions"><a class="edit_data wa-message-edit-main" data-id="<?=$row->id;?>" href="#"><i class="fa fa-pencil"></i> EDIT TEMPLATE</a><a class="wa-message-delete" data-toggle="modal" data-id="<?=$row->id;?>" data-target="#confirm-delete" title="Hapus Template" href="#"><i class="fa fa-trash"></i></a></div>
	</article>
	<?php endforeach; else: ?>
	<div class="wa-message-empty"><i class="fa fa-file-text-o"></i><div>Belum ada template pesan.</div></div>
	<?php endif; ?>
</div>
