{t("On-Call & Schedules")}

<%= if @tab == "escalation-policies" do %> <.link navigate={~p"/schedules/escalation-policies/new"} class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-500 transition-colors" > <.icon name="hero-plus" class="h-4 w-4" /> {t("New Policy")} <% else %> <.link navigate={~p"/schedules/new"} class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-500 transition-colors" > <.icon name="hero-plus" class="h-4 w-4" /> {t("New Schedule")} <% end %>

{t("Define on-call rotations and escalation policies for alert notifications.")}

<.link patch={~p"/schedules?tab=schedules"} class={[ "inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium transition-colors", @tab == "schedules" && "bg-gray-900 text-white dark:bg-white dark:text-gray-900", @tab != "schedules" && "bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700" ]} > {t("Schedules")} <.link patch={~p"/schedules?tab=escalation-policies"} class={[ "inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium transition-colors", @tab == "escalation-policies" && "bg-gray-900 text-white dark:bg-white dark:text-gray-900", @tab != "escalation-policies" && "bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700" ]} > {t("Escalation Policies")}
<%= if @tab == "escalation-policies" do %> <%= if Enum.empty?(@policies) do %>
<.icon name="hero-arrow-trending-up" class="h-12 w-12 text-gray-300 dark:text-gray-600 mx-auto mb-4" />

{t("No escalation policies")}

{t("Create an escalation policy to define how alerts are escalated to on-call users.")}

<% else %>
<%= for policy <- @policies do %> <% end %>
{t("Name")} {t("Rules")} {t("Repeat Count")}
{policy.name} {policy.repeat_count}
<% end %> <% else %> <%= if Enum.empty?(@schedules) do %>
<.icon name="hero-calendar-days" class="h-12 w-12 text-gray-300 dark:text-gray-600 mx-auto mb-4" />

{t("No schedules")}

{t("Create an on-call schedule to define rotation coverage.")}

<% else %>
<%= for schedule <- @schedules do %> <% end %>
{t("Name")} {t("Timezone")} {t("Currently On-Call")}
{schedule.name} {schedule.timezone} <%= if schedule.current_on_call do %> {schedule.current_on_call_name} <% else %> {t("No one")} <% end %>
<% end %> <% end %>