<div id="policies-last-updated" class="box overflow-hidden">

	<div class="box-header">
		<div class="sm:flex justify-between space-y-2 sm:space-y-0">
			<h5 class="box-title my-auto"><?php echo e(__('forms.policies')); ?>: <?php echo e($entity->entityable->first_name); ?>

				<?php echo e($entity->entityable->last_name); ?> <?php echo e($entity->entityable->short_name); ?></h5>
			<div class="block ltr:ml-auto rtl:mr-auto my-auto">
				<?php if($entity->entityable_type == 'App\Models\CRM\Company'): ?>
					<a href="<?php echo e(route('crm.companies.edit', $entity->entityable)); ?>"
						class="ti-btn ti-btn-soft-info py-1 px-3 my-0">Profil klijenta</a>
				<?php else: ?>
					<a href="<?php echo e(route('crm.individuals.edit', $entity->entityable)); ?>"
						class="ti-btn ti-btn-soft-info py-1 px-3 my-0">Profil klijenta</a>
				<?php endif; ?>
				<a href="<?php echo e(route('osiguranje.insurance-policies.create', $entity)); ?>"
					class="ti-btn ti-btn ti-btn-soft-success py-1 px-3 my-0">Kreriaj polisu</a>
			</div>
		</div>
	</div>

	<div class="box-body p-0 activity-table">
		<div class="overflow-auto">
			<table class="ti-custom-table ti-custom-table-head">
				<thead>
					<tr>
						<th scope="col"><?php echo e(__('forms.policy_number')); ?></th>
						<th scope="col"><?php echo e(__('forms.insured_amount')); ?></th>
						<th scope="col"><?php echo e(__('forms.premium')); ?></th>
						<th scope="col"><?php echo e(__('forms.start_date')); ?></th>
						<th scope="col"><?php echo e(__('forms.end_date')); ?></th>
						<th scope="col"><?php echo e(__('Status')); ?></th>
						<th scope="col" class="!text-end"><?php echo e(__('forms.Actions')); ?></th>
					</tr>
				</thead>
				<tbody>
					<?php if($policies): ?>
						<?php $__empty_1 = true; $__currentLoopData = $policies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $policy): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
							<tr>

								<td>
									<p class="text-sm mb-0 text-gray-800 dark:text-white"><?php echo e($policy->policy_number); ?></p>
								</td>
								<td>
									<code class="text-gray-800 dark:text-white"><?php echo e(number_format($policy->insured_amount, 2, ',', '.')); ?></code>
								</td>
								<td>
									<code class="text-gray-800 dark:text-white"><?php echo e(number_format($policy->premium, 2, ',', '.')); ?></code>
								</td>
								<td>
									<span class="text-xs text-gray-500 dark:text-white/70"><?php echo e($policy->start_date); ?></span>
								</td>
								<td>
									<span class="text-xs text-gray-500 dark:text-white/70"><?php echo e($policy->end_date); ?></span>
								</td>
								<td>
									<?php if($policy->status == 'active'): ?>
										<span class="badge bg-success/10 text-success py-1"><?php echo e($policy->status); ?></span>
									<?php else: ?>
										<span class="badge bg-red-100 text-red-800 py-1"><?php echo e($policy->status); ?></span>
									<?php endif; ?>
								</td>
								<td class="border-top-dashed pe-4 text-right">
									<!-- View Button -->

									<a href="#"
										class="rounded-sm bg-success/10 text-success hover:bg-success hover:text-white py-1 px-3 mr-2">
										<i class="ti ti-eye"></i>
									</a>

									<!-- Edit Button -->
									<a href="<?php echo e(route('osiguranje.insurance-policies.edit', [$entity, $policy])); ?>"
										class="rounded-sm bg-info/10 text-info hover:bg-info hover:text-white py-1 px-3 mr-2">
										<i class="ti ti-edit"></i>
									</a>

									<!-- Delete Button -->
									
								</td>
							</tr>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
							<tr>
								<td colspan="6" class="text-center text-gray-500">No policies found.</td>
							</tr>
						<?php endif; ?>
					<?php endif; ?>

				</tbody>
			</table>

		</div>
	</div>
</div>
<?php /**PATH C:\laragon\www\policypilot\resources\views/backend/insurance/insurance-policies/last-updated.blade.php ENDPATH**/ ?>