mirror of
https://github.com/we-promise/sure.git
synced 2026-07-16 23:05:22 +00:00
Ships DS::EmptyState — a centered icon / title / optional description /
optional action-slot state — plus a preview, tests, and an exemplar migration
of the recurring-transactions empty screen.
Consolidates the repeated `text-center py-12 + icon + title + description + CTA`
markup across the empty / no-data screens (recurring, imports, statements,
exports, and several connector setups). The audit flagged the self-hosted
feature-disabled pages rendering bare unstyled top-left text ("reads as a 500,
not a state") — wiring those through this primitive is the follow-up.
- app/components/DS/empty_state.rb: render DS::EmptyState.new(icon:, title:,
description:) with an optional `with_action` slot for the CTA.
- Migrate recurring_transactions/index empty branch.
Tests + rubocop + erb_lint clean.
Deferred: the remaining ~10 empty screens + the bare-text feature-disabled
states — same primitive, one migration each.
This commit is contained in:
committed by
GitHub
parent
4e0da0c237
commit
a3d6a7aede
23
test/components/previews/empty_state_component_preview.rb
Normal file
23
test/components/previews/empty_state_component_preview.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class EmptyStateComponentPreview < ViewComponent::Preview
|
||||
# @display container_classes max-w-[480px]
|
||||
def default
|
||||
render DS::EmptyState.new(
|
||||
icon: "inbox",
|
||||
title: "No transactions yet",
|
||||
description: "Imported and synced transactions will show up here."
|
||||
)
|
||||
end
|
||||
|
||||
# @display container_classes max-w-[480px]
|
||||
def with_action
|
||||
render DS::EmptyState.new(
|
||||
icon: "repeat",
|
||||
title: "No recurring transactions",
|
||||
description: "We detect patterns automatically, or you can scan now."
|
||||
) do |es|
|
||||
es.with_action do
|
||||
render DS::Link.new(text: "Scan now", icon: "search", variant: "primary", href: "#")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user