import { useState } from 'react';
import { Link } from 'react-router-dom';
import { Package, Plus, ExternalLink } from 'lucide-react';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
import { MarkSoldDialog } from '@/components/MarkSoldDialog';
import { useMarketplaceItems } from '@/hooks/useMarketplace';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import type { MarketplaceItem } from '@/lib/types';
function MyListingRow({ item }: { item: MarketplaceItem }) {
const [openSold, setOpenSold] = useState(false);
const listing = { pubkey: item.pubkey, identifier: item.identifier };
const soldOut = item.status === 'sold';
const price = item.price
? `${Number(item.price.amount).toLocaleString()} ${item.price.currency}`
: item.priceType === 'trade'
? 'Trade'
: 'Free';
return (
<>
{item.title}
{price}
{item.location ? ` · ${item.location}` : ''}
) : (
Loading your listings…
) : mine.length === 0 ? (You have no listings yet.