<%# locals: (entry:, unlock_path:) %> <%# Protection indicator - shows when entry is protected from sync overwrites %> <%= turbo_frame_tag dom_id(entry, :protection) do %> <% if entry.protected_from_sync? && !entry.excluded? %>
<%= icon "lock", size: "sm", color: "info" %> <%= t("entries.protection.title") %>
<%= icon "chevron-down", color: "info", class: "transition-transform [[open]>&]:rotate-180" %>

<%= t("entries.protection.description") %>

<% if entry.locked_field_names.any? %>

<%= t("entries.protection.locked_fields_label") %>

<% entry.locked_fields_with_timestamps.each do |field, timestamp| %>
<%= entry.class.human_attribute_name(field, moniker: Current.family&.moniker_label || "Family") %>
<%= timestamp.respond_to?(:strftime) ? l(timestamp.to_date, format: :long) : timestamp %>
<% end %>
<% end %> <%= link_to unlock_path, class: "w-full flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-lg border border-secondary text-primary hover:bg-surface-hover transition-colors", data: { turbo_method: :post, turbo_confirm: t("entries.protection.unlock_confirm"), turbo_frame: "_top" } do %> <%= icon "unlock", size: "sm" %> <%= t("entries.protection.unlock_button") %> <% end %>
<% end %> <% end %>