<section class='adminSection adminSection--buttons'>
	{{#eq userType 'account'}}
	<div class='classes__buttons'>
		{{> button style='full' colour='primary' to='/admin/class/add' content='Add a new class' size='lg' }}
	</div>
	{{/eq}}
</section>

<section class='adminSection classes'>
	<div class='classes__classes'>
		{{#each classes}}
			{{> class name=name teacher=teachers.[0] id=id }}
		{{/each}}
	</div>
</section>

<script>
	const classes = document.querySelectorAll('.classes__class');
	classes.forEach(c => {
		c.addEventListener('click', () => {
			window.location.href = `/admin/class/${c.getAttribute('data-id')}`;
		});
	});
</script>
