Skip to content

ATL-64: Refactor TransactionTable to extract demo data#22

Open
bolty-from-atl-bitlab[bot] wants to merge 1 commit intomasterfrom
atl-64-refactor-transaction-table-demo-data
Open

ATL-64: Refactor TransactionTable to extract demo data#22
bolty-from-atl-bitlab[bot] wants to merge 1 commit intomasterfrom
atl-64-refactor-transaction-table-demo-data

Conversation

@bolty-from-atl-bitlab
Copy link
Contributor

Changes

This PR refactors the TransactionTable component to properly separate demo data from the component implementation.

What was done:

  1. Created fixtures directory and data file

    • Added app/components/fixtures/transactionTableData.ts
    • Exported demoTransactions, demoPrisms, and demoContacts
    • Exported Transaction interface for type reuse
  2. Refactored TransactionTable component

    • Removed hardcoded demo data array from component
    • Component now properly accepts data via props
    • Uses the shared Transaction type from fixtures
    • Empty data is now truly empty (no fallback to demo data)
  3. Created Storybook stories

    • Added TransactionTable.stories.tsx with 6 story variants:
      • WithDemoData: Full demo dataset
      • Empty: Shows empty state
      • SingleTransaction: Minimal data
      • FewTransactions: Limited data for pagination
      • WithFavorites: Demonstrates favorite functionality
      • MixedStatuses: Shows all status types

Expected usage:

// Pass your own data
<TransactionTable 
  transactions={myTransactions}
  prisms={myPrisms}
  contacts={myContacts}
/>

// Empty state
<TransactionTable transactions={[]} />

// Use demo data in Storybook
import { demoTransactions } from './fixtures/transactionTableData';
<TransactionTable transactions={demoTransactions} />

Testing:

  • View in Storybook to see all variants
  • Component accepts empty arrays and displays correctly
  • Demo data is only used when explicitly passed as props

Fixes ATL-64

- Created fixtures/transactionTableData.ts with demo transactions, prisms, and contacts
- Removed hardcoded demo data from TransactionTable component
- Component now accepts data as props (transactions, prisms, contacts)
- Added TransactionTable.stories.tsx with multiple story variants:
  - WithDemoData: Shows table with full demo dataset
  - Empty: Shows empty state
  - SingleTransaction: Minimal data test case
  - FewTransactions: Limited data for pagination testing
  - WithFavorites: Demonstrates favorite functionality
  - MixedStatuses: Shows all status types

Fixes ATL-64
@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aurora Ready Ready Preview, Comment Feb 24, 2026 5:27am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant