All files / app/components/home/transaction-list transaction-list.tsx

0% Statements 0/16
0% Branches 0/5
0% Functions 0/1
0% Lines 0/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                                                 
import { TransactionListEmpty } from './transaction-list-empty';
import { TransactionListError } from './transaction-list-error';
import { TransactionListLoading } from './transaction-list-loading';
import { TransactionListTitle } from './transaction-list-title';
import { Flex } from '@stacks/ui';
import { StacksNode } from '@store/stacks-node';
import React, { FC } from 'react';
 
interface TransactionListProps {
  txCount: number;
  loading: boolean;
  node: StacksNode;
  error: string | null;
}
 
export const TransactionList: FC<TransactionListProps> = props => {
  const { node, txCount, loading, children, error } = props;
 
  Iif (loading) return <TransactionListLoading />;
  Iif (error && txCount === 0) return <TransactionListError node={node} error={error} />;
  Iif (txCount === 0) return <TransactionListEmpty />;
 
  return (
    <>
      <Flex mb="loose" justifyContent="space-between" alignItems="flex-end">
        <TransactionListTitle>Activity</TransactionListTitle>
        {/* TODO: show all pending tx number here and link to explorer */}
      </Flex>
      {children}
    </>
  );
};