Module: Dbwatcher::DiagramHelper

Defined in:
app/helpers/dbwatcher/diagram_helper.rb

Instance Method Summary collapse

Instance Method Details

#diagram_button_classes(type = :default) ⇒ Object

Generate button classes for diagram controls



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/dbwatcher/diagram_helper.rb', line 6

def diagram_button_classes(type = :default)
  base_classes = "compact-button text-xs rounded"

  button_styles = {
    primary: "bg-blue-medium text-white px-3 py-1 hover:bg-navy-dark",
    secondary: "bg-navy-dark text-white px-2 py-1 hover:bg-blue-medium",
    toggle: "bg-blue-medium text-white px-2 py-1 hover:bg-navy-dark flex items-center gap-1",
    icon: "bg-white border border-gray-300 hover:bg-gray-50 p-1",
    danger: "bg-red-500 text-white px-2 py-1 hover:bg-red-600",
    success: "bg-green-500 text-white px-2 py-1 hover:bg-green-600"
  }

  style = button_styles[type] || button_styles[:primary]
  "#{base_classes} #{style}"
end