Skip to content

bug: 'Export to CSV' button is enabled even when there are 0 transactions #176

@mahiptiwari1000

Description

@mahiptiwari1000

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

  1. Go to the Transactions page (or any screen that lists transactions and includes the "Export to CSV" button).
  2. Filter or load a state where there are 0 transactions returned.
  3. Observe the "Export to CSV" button.
  4. Click the button.
  5. 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.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions