<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>OpenVidu Meet Tutorial</title>
		<!-- Bootstrap -->
		<link
			href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
			rel="stylesheet"
		/>
		<link rel="stylesheet" href="css/videoRoom.css" />
		<script src="{{ webcomponentSrc }}"></script>
	</head>

	<body>
		<div class="container-fluid">
			<!-- Left Sidebar Panel -->
			<div id="control-panel" class="d-flex flex-column">
				<span>
					<span id="participant-role" class="h5">
						{{#isModerator}}
						<span class="badge bg-success">Moderator</span>
						{{/isModerator}}

						{{^isModerator}}
						<span class="badge bg-secondary">Participant</span>
						{{/isModerator}}
					</span>
					<span id="room-id" class="text-muted">
						{{ roomId }}
					</span>
				</span>
				<!-- Commands -->
				<div class="section">
					<h5 class="title">Commands</h5>
					{{#isModerator}}
					<button id="end-meeting-btn" class="btn btn-danger">
						End Meeting
					</button>
					{{/isModerator}}
					<button id="leave-room-btn" class="btn btn-warning">
						Leave Room
					</button>
					{{#isModerator}}
					<input
						type="text"
						id="participant-identity-input"
						placeholder="Participant Identity"
						class="form-control mb-2"
					/>
					<button id="kick-participant-btn" class="btn btn-info">
						Kick Participant
					</button>
					{{/isModerator}}
				</div>

				<!-- Events -->
				<div class="section">
					<h5 class="title">Events</h5>
					<ul id="events-list" class="log-list">
						<!-- Events will be added dynamically here -->
					</ul>
				</div>

				<!-- Webhooks Log -->
				<div class="section">
					<h5 class="title">Webhook</h5>
					<div class="form-check mb-2">
						<input
							class="form-check-input"
							type="checkbox"
							value=""
							id="show-all-webhooks"
						/>
						<label class="form-check-label" for="show-all-webhooks">
							Show all
						</label>
					</div>
					<ul id="webhook-log-list" class="log-list">
						<!-- Webhooks will be added dynamically here -->
					</ul>
				</div>
			</div>

			<!-- Main Content Section -->
			<div id="main-content" class="d-flex flex-column">
				<!-- Web Component Section -->
				<div id="meeting-container">
					<openvidu-meet
						room-url="{{ roomUrl }}"
						participant-name="{{ participantName }}"
						{{#showOnlyRecordings}}
						show-only-recordings=true
						{{/showOnlyRecordings}}
					></openvidu-meet>
				</div>
			</div>
		</div>

		<script src="/socket.io/socket.io.js"></script>
		<script type="module" src="../js/webcomponent.js"></script>
		<!-- Bootstrap JS -->
		<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
	</body>
</html>
