<?php defined('BASEPATH') or exit('No direct script access allowed');

$title = isset($title) ? $title : '';
$subtitle = isset($subtitle) ? $subtitle : '';
$actions = isset($actions) ? $actions : '';
$body = isset($body) ? $body : '';
$footer = isset($footer) ? $footer : '';
$class = isset($class) ? $class : '';
?>

<div class="erp-modal-layout<?= $class ? ' ' . $class : ''; ?>">
	<div class="erp-modal-header">
		<div class="min-w-0 flex-1">
			<?php if ($title !== '') { ?>
				<h2 class="erp-modal-title"><?= html_escape($title); ?></h2>
			<?php } ?>
			<?php if ($subtitle !== '') { ?>
				<p class="erp-modal-subtitle"><?= html_escape($subtitle); ?></p>
			<?php } ?>
		</div>
		<?php if ($actions !== '') { ?>
			<div class="erp-modal-actions">
				<?= $actions; ?>
			</div>
		<?php } ?>
	</div>
	<div class="erp-modal-body">
		<?= $body; ?>
	</div>
	<?php if ($footer !== '') { ?>
		<div class="erp-modal-footer">
			<?= $footer; ?>
		</div>
	<?php } ?>
</div>
