mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 22:05:07 +00:00
* first srcl pass! * HOLY MFIN KBAR * first last search * put the borders back * button! * oops * toolbar! * lol * bump dreamland, make kbar actually reactive? * shorter timeout lol * identity picker component * nuke that lol * seen_hints * woah * hint sys pt 1 * HINTS * HINTS AND SHORTCUTS * styles, BACKSPACE * nav on home * bananananana * click, starring adam sandler * scrool * lint pass * autoed complete * shut * brake the man * dunno why those got unmerged * path oopsie * backspace on audit logs * whitespace * i thought i told you to shut up * mr. brakeman
35 lines
674 B
Ruby
35 lines
674 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Components::Inspector < Components::Base
|
|
def initialize(record, small: false)
|
|
@record = record
|
|
@small = small
|
|
end
|
|
|
|
def view_template
|
|
return unless Rails.env.development?
|
|
|
|
details class: "inspector" do
|
|
summary do
|
|
if @small
|
|
plain record_id
|
|
else
|
|
plain "inspect #{record_id}"
|
|
end
|
|
end
|
|
pre class: "inspector-content" do
|
|
unless @record.nil?
|
|
raw safe(ap @record)
|
|
else
|
|
plain "nil"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def record_id
|
|
"#{@record.class.name} #{@record&.try(:public_id) || @record&.id}"
|
|
end
|
|
end
|