-
Couldn't load subscription status.
- Fork 81
Description
Export to CSV button is enabled even when there are 0 transactions
Expected Behavior
When there are no transactions in the table/list, the "Export to CSV" button should be disabled and not clickable.
Current Behavior
The "Export to CSV" button is currently enabled and clickable even when there are 0 transactions.
Users can click it, which either:
- does nothing, or
- downloads an empty CSV.
This is confusing because it implies there is exportable data when there is not.
Possible Solution
Add a conditional check on render:
- If
transactions.length === 0, render the button in a disabled state (e.g.disabled={true}/aria-disabled="true"and remove onClick). - If
transactions.length > 0, render the normal interactive button.
Also ensure styling reflects disabled (grayed out, no hover).
Steps to Reproduce
- Go to the Transactions page (or any screen that lists transactions and includes the "Export to CSV" button).
- Filter or load a state where there are 0 transactions returned.
- Observe the "Export to CSV" button.
- Click the button.
- Notice that the button was clickable even though there are no rows to export.
Context (Environment)
This affects usability and clarity.
Users think something went wrong when they click "Export to CSV" and either get an empty file or no response.
We want to avoid support tickets / confusion when no data is available.
This is mostly a UI-state issue, not a backend issue.
