import type { IndexedOutput } from '@1sat/types' import { useState } from 'react' import type { EnrichedOrdinal, TokenBalance } from '../lib/scanner' import { SWEEP_BATCH_SIZE } from '../lib/sweeper' import { formatSats, formatTokenAmount } from '../lib/utils' import { Badge } from './ui/badge' import { Button } from './ui/button' import { Input } from './ui/input' function isImageType(ct: string): boolean { return ct.startsWith('image/') && ct !== 'image/svg+xml' } function OrdinalCard({ ordinal, isSelected, onToggle, }: { ordinal: EnrichedOrdinal; isSelected: boolean; onToggle: () => void }) { const ct = ordinal.contentType ?? '' const isImage = isImageType(ct) const subtype = ct.includes('/') ? ct.split('/')[1] : ct return (
{isSelected && '\u2713'}
{!ordinal.contentUrl ? ( {'\u25C6'} ) : isImage ? ( {ordinal.name ) : (