<?php
namespace JetStudioModule\DataModel;

use Jet\Tr;
use JetStudio\JetStudio_UI;

$list = DataModels::getClasses();

?>

	<?=JetStudio_UI::search(
		id: 'class_search',
		placeholder: Tr::_('Search for class ...'),
		search_action: 'DataModel.search.search()',
		search_reset_action: 'DataModel.search.reset()') ?>


<?php foreach( $list as $item ):
	if( $item->getFullClassName() == DataModels::getCurrentClassName() ):
		?>
		<div class="card" id="current-item" style="border-right: none;margin-bottom: 10px;margin-left: 10px;" >
			<div class="card-body">
				<?php require 'list/item.phtml'; ?>
			</div>
		</div>
		<?php
		break;
	endif;
endforeach; ?>

<table class="table table-striped">

	<?php foreach( $list as $item ):
		if( $item->getFullClassName() != DataModels::getCurrentClassName() ): ?>
		<tr class="class_list_item" data-name="<?=$item->getFullClassName()?>">
			<td><a href="?class=<?= $item->getFullClassName() ?>"><?= $item->getFullClassName() ?></a></td>
		</tr>
		<?php endif;
	endforeach; ?>

</table>
