aboutsummaryrefslogtreecommitdiff
path: root/src/components/shared/flash_messages.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/shared/flash_messages.cr')
-rw-r--r--src/components/shared/flash_messages.cr11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/shared/flash_messages.cr b/src/components/shared/flash_messages.cr
new file mode 100644
index 0000000..bc44440
--- /dev/null
+++ b/src/components/shared/flash_messages.cr
@@ -0,0 +1,11 @@
+class Shared::FlashMessages < BaseComponent
+ needs flash : Lucky::FlashStore
+
+ def render
+ flash.each do |flash_type, flash_message|
+ div class: "flash-#{flash_type}", flow_id: "flash" do
+ text flash_message
+ end
+ end
+ end
+end