defmodule LiveBeatsWeb.ModalComponent do
use LiveBeatsWeb, :live_component
@impl true
def render(assigns) do
~H"""
<%= live_patch raw("×"), to: @return_to, class: "phx-modal-close" %>
<%= live_component @component, @opts %>
"""
end
@impl true
def handle_event("close", _, socket) do
{:noreply, push_patch(socket, to: socket.assigns.return_to)}
end
end