Sha256: ca8420599ace559bba327205e6b82d64024c7d708b8919d327306d4e39111e46
Contents?: true
Size: 573 Bytes
Versions: 3
Compression:
Stored size: 573 Bytes
Contents
module Components::AlertHelper def render_alert(title:, description:, variant: :default, icon: true) alert_classes = case variant.to_sym when :default "[&>svg]:text-foreground bg-background text-foreground" when :error, :danger, :alert, :destructive "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive" else "border-#{variant}/50 text-#{variant} dark:border-#{variant} [&>svg]:text-#{variant}" end render "components/ui/alert", title:, description:, alert_classes:, variant:, icon: end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
shadcn-ui-0.0.5 | app/helpers/components/alert_helper.rb |
shadcn-ui-0.0.4 | app/helpers/components/alert_helper.rb |
shadcn-ui-0.0.3 | app/helpers/components/alert_helper.rb |