defmodule CanneryWeb.ModalComponent do use CanneryWeb, :live_component @impl true def render(assigns) do ~L"""
<%# close button %> <%= live_patch to: @return_to, class: "absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out" do %> <% end %> <%# modal content %>
<%= live_component @component, @opts %>
""" end @impl true def handle_event("close", _, socket) do {:noreply, push_patch(socket, to: socket.assigns.return_to)} end end