identity-vault/app/components/bootleg_turbo_button.rb
nora 9998147a4e
epic: overhaul program management experience (#188)
* temp commit

* lemme do it

* nope

* let them do it too

* collab invite model

* better visuals on progman

* waow

* danger will robinson

* show apps on backend & link user

* first pass on app auditability!

* no lastnaming admins

* async frame that shit!

* waugh

* can't add yourself

* fix reinvite

* sidebar badging

* lint...

* gotta be on the app!

* let that get rescued by applcon

* already in revoke_all_authorizations

* woag

* the routes you grew up with no longer exist

* what would the UI for that even be?

* sorch

* much better!

* frickin validations
2026-03-02 22:15:13 -05:00

23 lines
613 B
Ruby

class Components::BootlegTurboButton < Components::Base
def initialize(path, text:, **opts)
@path = path
@text = text
@opts = opts
end
def view_template
container_id = @opts.delete(:id) || "btb-#{@path.parameterize}"
div(id: container_id, class: "btb-container") do
button(
class: "secondary small-btn",
hx_get: @path,
hx_target: "##{container_id}",
hx_swap: "innerHTML",
**@opts
) { @text }
div(class: "hx-loader") do
vite_image_tag "images/loader.gif", style: "image-rendering: pixelated;"
end
end
end
end