# frozen_string_literal: true # @param type [String] Classic notification type `error`, `alert` and `info` + custom `success` # @param data [String, Hash] `String` for backward compatibility, # `Hash` for the new functionality `{title: '', body: '', timeout: 5, countdown: false, action: { url: '', method: '', name: ''}}`. # The `title` attribute for `Hash` is mandatory. module Signum module NotificationBody class Component < ViewComponent::Base attr_reader :signal, :data def initialize(signal, data) @signal = signal @data = data.nil? ? {} : data.deep_symbolize_keys end end end end