<%= @teacher.username %>
<% if @teacher.discarded? %>
Deactivated
<% else %>
Active
<% end %>
<%= link_to edit_admin_teacher_path(@teacher),
class: "inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50" do %>
Edit
<% end %>
<% if @teacher.discarded? %>
<%= link_to admin_teacher_reactivation_path(@teacher),
data: { turbo_method: :post, turbo_confirm: "Are you sure you want to reactivate this teacher?" },
class: "inline-flex items-center px-4 py-2 border border-green-300 shadow-sm text-sm font-medium rounded-md text-green-700 bg-white hover:bg-green-50" do %>
Reactivate
<% end %>
<%= link_to admin_teacher_path(@teacher),
data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to permanently delete this teacher? This action cannot be undone." },
class: "inline-flex items-center px-4 py-2 border border-red-300 shadow-sm text-sm font-medium rounded-md text-red-700 bg-white hover:bg-red-50" do %>
Permanently Delete
<% end %>
<% else %>
<%= link_to admin_teacher_deactivation_path(@teacher),
data: { turbo_method: :post, turbo_confirm: "Are you sure you want to deactivate this teacher?" },
class: "inline-flex items-center px-4 py-2 border border-red-300 shadow-sm text-sm font-medium rounded-md text-red-700 bg-white hover:bg-red-50" do %>
Deactivate
<% end %>
<% end %>
<%= admin_show_attributes(
@teacher,
attributes: %i[id username email name created_at updated_at]
) %>
<% if @teacher.classrooms.any? %>