<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ taglib  prefix="fn" uri="jakarta.tags.functions" %>

<%@ attribute name="data" required="true" type="ru.bitel.bgbilling.server.tags.TagPhoneSelector" %>

<%@ tag body-content="empty" %>

<div class="mt-3 hstack gap-3 overflow-x-hidden">
	<c:forEach var="item" items="${data.phoneList}">
		<c:set var="n" value="${item.msisdn}"/>
		<c:set var="sel"><c:if test="${n eq curPhone.msisdn}">border border-3 border-primary</c:if></c:set>
		<div class="card p-3 mx-1 my-3 text-nowrap ${sel}" style="min-width: 160px; cursor: pointer;" onclick="window.location='?msisdn=${n}'">+7 ${fn:substring(n,0,3)} ${fn:substring(n,3,5)} ${fn:substring(n,5,7)} ${fn:substring(n,7,10)}</div>
	</c:forEach>
</div>