<.link
navigate={~p"/schedules?tab=escalation-policies"}
class="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"
>
<.icon name="hero-arrow-left" class="h-5 w-5" />
{@page_title}
<.form for={@form} phx-change="validate" phx-submit="save" class="space-y-6">
<.input field={@form[:name]} type="text" label={t("Name")} required />
<.input field={@form[:description]} type="textarea" label={t("Description")} />
<.input
field={@form[:handoff_notifications_mode]}
type="select"
label={t("Send On-Call Handoff Notifications")}
options={[
{t("When in use by a service"), "when_in_use_by_service"},
{t("Always"), "always"},
{t("Never"), "never"}
]}
/>
<.icon name="hero-arrow-path" class="h-5 w-5 text-gray-500" />
{t("If no one acknowledges, repeat this policy")}
<.input field={@form[:repeat_count]} type="number" min="1" max="10" class="w-20" />
{t("time(s).")}
<.button type="submit" phx-disable-with={t("Saving...")}>
{t("Save Policy")}
<.link
navigate={~p"/schedules?tab=escalation-policies"}
class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"
>
{t("Cancel")}