diff --git a/lib/sanbase_web/live/monitored_twitter_handle/monitored_twitter_handle_live.ex b/lib/sanbase_web/live/monitored_twitter_handle/monitored_twitter_handle_live.ex index a03e97ef4f..c4bbe03f0f 100644 --- a/lib/sanbase_web/live/monitored_twitter_handle/monitored_twitter_handle_live.ex +++ b/lib/sanbase_web/live/monitored_twitter_handle/monitored_twitter_handle_live.ex @@ -7,10 +7,10 @@ defmodule SanbaseWeb.MonitoredTwitterHandleLive do def render(assigns) do ~H"""
-
+
<.table id="monitored_twitter_handles" rows={@handles}> <:col :let={row} label="Status"> -

+

<%= row.status |> String.replace("_", " ") |> String.upcase() %>

@@ -28,20 +28,18 @@ defmodule SanbaseWeb.MonitoredTwitterHandleLive do <.form for={@form} phx-submit="update_status"> <.input type="text" class="" field={@form[:comment]} placeholder="Comment..." /> - <.button + - Approve - - <.button + color="green" + display_text="Approve" + /> + - Decline - + color="red" + display_text="Decline" + /> @@ -50,6 +48,20 @@ defmodule SanbaseWeb.MonitoredTwitterHandleLive do """ end + def bbutton(assigns) do + ~H""" + <.button + name={@name} + value={@value} + class={"my-1 focus:outline-none text-white bg-#{@color}-700 hover:bg-#{@color}-800 focus:ring-4 focus:ring-#{@color}-300 + font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-#{@color}-600 dark:hover:bg-#{@color}-700 + dark:focus:ring-#{@color}-800"} + > + <%= @display_text %> + + """ + end + @impl true def mount(_params, _session, socket) do {:ok, @@ -82,6 +94,7 @@ defmodule SanbaseWeb.MonitoredTwitterHandleLive do record |> Map.put(:status, status) |> Map.put(:comment, comment) + |> Map.put(:status_color, status_to_color(status)) record -> record