<template name="messagePopup">
	{{#if isOpen}}
		{{#if sidebar}}
			<ul class="rooms-list__list rooms-list__toolbar-search" style="top: {{sidebarHeaderHeight}}; height: calc(100vh - {{sidebarHeaderHeight}}); width: {{sidebarWidth}}">
				{{#each data}}
						{{> Template.dynamic template=../template data=toolbarData }}
				{{/each}}
			</ul>
		{{else}}
			<div class="message-popup-position">
				<div class="message-popup content-background-color {{cls}}" id="popup">
					{{#if title}}
						<div class="message-popup-title secondary-background-color border-component-color">
							{{title}}
						</div>
					{{/if}}
					<div class="message-popup-items">
						{{#each data}}
							<div class="popup-item" data-id="{{_id}}">
								{{> Template.dynamic template=../template}}
							</div>
						{{/each}}
					</div>
					{{#unless data}}
						{{#unless isLoading.get}}
							{{#if emptyTemplate}}
								{{> Template.dynamic template=emptyTemplate}}
							{{/if}}
						{{/unless}}
					{{/unless}}
					{{#if isLoading.get}}
						{{> loading}}
					{{/if}}
				</div>
			</div>
		{{/if}}
	{{/if}}
</template>
