CookiesConsentCardComponent

InfoGeneratePackages

This Ruby code defines a class named `CenteredCardWithNeutralColorComponent` which inherits from `ApplicationComponent`. The class provides a `template` method that defines the structure of a UI component using HTML-like syntax within Ruby. The component appears to be a card with neutral colors, centered content, a title of "Cookies!", a descriptive text about the use of cookies, and two buttons labeled "Accept" and "Deny". The card is styled with classes corresponding to width, background color, text color, and alignment utilities, and it includes dedicated areas for the card's body and actions.

# frozen_string_literal: true

class CenteredCardWithNeutralColorComponent < ApplicationComponent
  def template
    div(class: "card w-96 bg-neutral text-neutral-content") do
      div(class: "card-body items-center text-center") do
        h2(class: "card-title") { "Cookies!" }
        p { "We are using cookies for no reason." }
        div(class: "card-actions justify-end") do
          button(class: "btn btn-primary") { "Accept" }
          button(class: "btn btn-ghost") { "Deny" }
        end
      end
    end
  end
end