diff --git a/lib/cannery_web/live/live_helpers.ex b/lib/cannery_web/live/live_helpers.ex index 4422316..db8f4eb 100644 --- a/lib/cannery_web/live/live_helpers.ex +++ b/lib/cannery_web/live/live_helpers.ex @@ -3,9 +3,12 @@ defmodule CanneryWeb.LiveHelpers do Contains common helper functions for liveviews """ - import Phoenix.Component + use Phoenix.Component alias Phoenix.LiveView.JS + attr :return_to, :string, required: true + slot(:inner_block) + @doc """ Renders a live component inside a modal. @@ -79,6 +82,11 @@ defmodule CanneryWeb.LiveHelpers do |> JS.hide(to: "#modal-content", transition: "fade-out-scale") end + attr :action, :string, required: true + attr :value, :boolean, required: true + attr :id, :string + slot(:inner_block) + @doc """ A toggle button element that can be directed to a liveview or a live_component's `handle_event/3`.