Class: Global::Suggestion

Inherits:
Components::Base
  • Object
show all
Defined in:
app/components/databasium/global/suggestion.rb

Instance Method Summary collapse

Constructor Details

#initialize(suggestions:) ⇒ Suggestion

Returns a new instance of Suggestion.



6
7
8
# File 'app/components/databasium/global/suggestion.rb', line 6

def initialize(suggestions:)
  @suggestions = suggestions
end

Instance Method Details

#view_templateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/components/databasium/global/suggestion.rb', line 10

def view_template
  div(
    class: "flex flex-col gap-2 bg-panel border-1 border-border rounded-xl p-2 m-4",
    id: "suggestion"
  ) do
    @suggestions.each do |suggestion|
      div(class: "flex items-center gap-2") do
        heroicon("information-circle", variant: :outline, options: { class: "w-6 h-6" })
        span(class: "text-main-text") { suggestion }
      end
    end
  end
end