Adds refresh button

This commit is contained in:
2024-05-01 16:02:15 -07:00
parent 4f1b1bcca2
commit 002c3d8688
3 changed files with 34 additions and 22 deletions

View File

@@ -1324,19 +1324,23 @@
:body (mm/default-step-body
{}
[:div
(fc/with-field :client/square-auth-token
(com/validated-field
{:errors (fc/field-errors)
:label "Square Auth Token"}
(com/text-input {:name (fc/field-name)
:error? (fc/error?)
:hx-get (bidi/path-for ssr-routes/only-routes ::route/refresh-square-locations)
:hx-trigger "keyup changed delay:1s queue:none"
:hx-indicator "#square-locations"
:hx-target "#square-locations"
:placeholder "Token from square"
:class "w-64"
:value (fc/field-value)})))
[:div.flex.gap-2.items-center
(fc/with-field :client/square-auth-token
(com/validated-field
{:errors (fc/field-errors)
:label "Square Auth Token"}
(com/text-input {:name (fc/field-name)
:id "square-token"
:error? (fc/error?)
:placeholder "Token from square"
:class "w-64"
:value (fc/field-value)})))
(com/button {:hx-get (bidi/path-for ssr-routes/only-routes ::route/refresh-square-locations)
:hx-include "#square-token"
:hx-trigger "click"
:hx-indicator "#square-locations"
:hx-target "#square-locations" }
"Refresh")]
(fc/with-field :client/square-locations
(square-location-table))])