With a Live Component (https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html), the phx-click events it triggers a handle_event so you can easily elixir functions elsewhere, but when looking at the Phoenix Component (https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html), I am a little confused about what phx-click event does/how to use it.
I can see in the core_components.ex it's used to run some JavaScript - but was wondering if that was all?
For example if I wanted to navigate from a phoenix component to a liveview component, is that something I could do with phx-click? Or would it be wrong to use a phx-click for navigation and I should use <.link navigate={...} /> instead?
Essentially I'm looking for a way to do the below but with a function component on a div
def handle_event("view_server", params, socket) do
{:noreply, push_redirect(socket, to: "/server/#{params["id"]}")}
end