<%= upload_error_to_string(err) %>
+ <% end %> +diff --git a/lib/chiya_web.ex b/lib/chiya_web.ex index 7f807b4..4f08afc 100644 --- a/lib/chiya_web.ex +++ b/lib/chiya_web.ex @@ -93,6 +93,7 @@ defmodule ChiyaWeb do alias Phoenix.LiveView.JS # Custom functions + import ChiyaWeb.AdminComponents import ChiyaWeb.Format, only: [from_now: 1, pretty_date: 1] alias ChiyaWeb.Markdown diff --git a/lib/chiya_web/components/admin_components.ex b/lib/chiya_web/components/admin_components.ex new file mode 100644 index 0000000..2a8220d --- /dev/null +++ b/lib/chiya_web/components/admin_components.ex @@ -0,0 +1,132 @@ +defmodule ChiyaWeb.AdminComponents do + + use Phoenix.Component + use Phoenix.VerifiedRoutes, + endpoint: ChiyaWeb.Endpoint, + router: ChiyaWeb.Router, + statics: ChiyaWeb.static_paths() + + import ChiyaWeb.CoreComponents + + @doc """ + Renders a UI for uploading files + """ + + attr :upload, :map, required: true + attr :cancel_upload, :string, default: "cancel-upload" + + def live_upload(assigns) do + ~H""" +
<%= upload_error_to_string(err) %>
+ <% end %> +<%= upload_error_to_string(err) %>
+ <% end %> +<%= upload_error_to_string(err) %>
- <% end %> -<%= upload_error_to_string(err) %>
- <% end %> -