<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/asset_tags_selector/init.jsp" %>

<%
Map<String, Object> data = (Map<String, Object>)request.getAttribute("liferay-asset:asset-tags-selector:data");

List<Map<String, String>> selectedItems = (List<Map<String, String>>)data.get("selectedItems");
%>

<div>
	<div class="lfr-tags-selector-content">

		<%
		for (Map<String, String> selectedItem : selectedItems) {
		%>

			<input name="<%= (String)data.get("inputName") %>" type="hidden" value="<%= selectedItem.get("value") %>" />

		<%
		}
		%>

		<div class="form-group">
			<label>
				<liferay-ui:message key="tags" />
			</label>

			<div class="input-group input-group-stacked-sm-down">
				<div class="input-group-item">
					<div class="form-control form-control-tag-group">

						<%
						for (Map<String, String> selectedItem : selectedItems) {
						%>

							<clay:label
								dismissible="<%= true %>"
								label='<%= selectedItem.get("label") %>'
							/>

						<%
						}
						%>

						<input class="form-control-inset" type="text" value="" />
					</div>
				</div>
			</div>
		</div>

		<button class="btn btn-secondary" type="button">
			<liferay-ui:message key="select" />
		</button>
	</div>

	<react:component
		module="asset_tags_selector/AssetTagsSelectorTag.es"
		props="<%= data %>"
	/>
</div>