<.breadcrumb items={[ %{label: "Dashboard", navigate: ~p"/dashboard"}, %{label: "Reports"} ]} />

{t("Scheduled Reports")}

{t("Automated report generation and email delivery")}

<%!-- Create Report Form --%> <%= if @show_form do %>

{t("Create Report")}

<.form id="report-form" for={@form} phx-submit="save" class="space-y-4">
<% end %> <%!-- Reports List --%> <%= if @reports != [] do %>
<%= for report <- @reports do %> <% end %>
{t("Name")} {t("Type")} {t("Schedule")} {t("Recipients")} {t("Last Run")} {t("Status")} {t("Actions")}
{report.name} {humanize_type(report.report_type)} {humanize_schedule(report.schedule)} {format_recipients(report.recipients)} <%= if report.last_run_at do %> {Calendar.strftime(report.last_run_at, "%b %d, %H:%M")} <% else %> - <% end %> <% {label, classes} = status_badge(report.last_run_status) %> {label}
<% else %>
<.icon name="hero-document-chart-bar" class="w-12 h-12 mx-auto text-gray-300 dark:text-gray-600" />

{t("No scheduled reports")}

{t("Create a report to start receiving automated updates via email.")}

<% end %>