import { useMemo } from 'react';
import cn from 'classnames';
import { Box, Icon, Row } from '@tlon/indigo-react';
import { RollerTransaction } from '@urbit/roller-api';
import { format, fromUnixTime } from 'date-fns';
import { useTimerStore } from 'store/timerStore';
import {
TRANSACTION_STATUS_ICONS,
TRANSACTION_TYPE_ICONS,
TRANSACTION_TYPE_TITLES,
} from 'lib/constants';
import { abbreviateAddress } from 'lib/utils/address';
import { titleize } from 'form/formatters';
import LayerIndicator from 'components/L2/LayerIndicator';
import { useExploreTxUrl } from 'lib/explorer';
interface TransactionRowProps extends RollerTransaction {
className?: string;
layer?: 1 | 2;
}
export const TransactionRow = ({
className = '',
ship,
type = '',
hash,
status = 'pending',
time,
layer = 2,
}: TransactionRowProps) => {
const { nextRoll } = useTimerStore();
const label = useMemo(() => {
return TRANSACTION_TYPE_TITLES[type] || type;
}, [type]);
const icon = useMemo(() => {
return