<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SharedHierarchyViewer.aspx.cs"
	Inherits="PDI.Web.SharedHierarchyViewer" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
	<title>Carpeta Compartida</title>
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
	<style>
		body,
		html {
			font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
			font-size: 14px;
			margin: 0;
			padding: 0;
			background-color: #f4f6f9;
		}

		.container {
			max-width: 1200px;
			margin: 0 auto;
			padding: 20px;
		}

		.header {
			background-color: #fff;
			padding: 20px;
			border-radius: 8px;
			box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
			margin-bottom: 20px;
		}

		.folder-title {
			font-size: 1.5rem;
			color: #333;
			margin: 0;
		}

		.document-list {
			background-color: #fff;
			border-radius: 8px;
			box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
			overflow: hidden;
		}

		.document-item {
			display: flex;
			align-items: center;
			padding: 15px 20px;
			border-bottom: 1px solid #eee;
			transition: background-color 0.2s;
		}

			.document-item:hover {
				background-color: #f8f9fa;
			}

		.document-icon {
			font-size: 1.5rem;
			color: #dc3545;
			margin-right: 15px;
			width: 30px;
			text-align: center;
		}

		.document-name {
			flex-grow: 1;
			font-weight: 500;
			color: #333;
			text-decoration: none;
		}

		.document-date {
			color: #777;
			font-size: 0.9rem;
			margin-right: 20px;
		}

		.document-actions a {
			color: #007bff;
			text-decoration: none;
			margin-left: 10px;
		}

			.document-actions a:hover {
				text-decoration: underline;
			}
	</style>
</head>

<body>
	<form id="form1" runat="server">
		<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

		<div class="container">
			<div class="header">
				<h1 class="folder-title"><i class="fas fa-folder-open"
					style="color: #ffc107; margin-right: 10px;"></i>
					<asp:Label ID="lblFolderName" runat="server"></asp:Label>
				</h1>
				<p>
					Compartido por:
					<asp:Label ID="lblSharedBy" runat="server"></asp:Label>
				</p>
			</div>

			<div class="document-list">
				<asp:Repeater ID="rptDocuments" runat="server">
					<ItemTemplate>
						<div class="document-item">
							<div class="document-icon">
								<i class="fas fa-file-pdf"></i>
							</div>
							<a href='<%# "SharedDocumentViewer.aspx?ID=" + Eval("ShareLink") %>' target="_blank"
								class="document-name">
								<%# (Eval("UserFilename")==null || Eval("UserFilename")==DBNull.Value ||
								string.IsNullOrWhiteSpace(Eval("UserFilename").ToString()) ?
								Eval("Name") : Eval("UserFilename")) %>
							</a>
							<div class="document-date">
								<%# Eval("Created", "{0:dd/MM/yyyy}" ) %>
							</div>
							<div class="document-actions">
								<a href='<%# "SharedDocumentViewer.aspx?ID=" + Eval("ShareLink") %>'
									target="_blank">
									<i class="fas fa-eye"></i>Ver
								</a>
							</div>
						</div>
					</ItemTemplate>
				</asp:Repeater>
				<asp:Panel ID="pnlEmpty" runat="server" Visible="false"
					Style="padding: 20px; text-align: center; color: #777;">
					Esta carpeta está vacía.
				</asp:Panel>
			</div>
		</div>
	</form>
</body>

</html>