diff --git a/src/components/MarketplaceItemCard.tsx b/src/components/MarketplaceItemCard.tsx index 49b203f..a7f88f2 100644 --- a/src/components/MarketplaceItemCard.tsx +++ b/src/components/MarketplaceItemCard.tsx @@ -25,7 +25,6 @@ import { Textarea } from '@/components/ui/textarea'; import { Label } from '@/components/ui/label'; import { useAuthor } from '@/hooks/useAuthor'; import { useCurrentUser } from '@/hooks/useCurrentUser'; -import { useCashu } from '@/hooks/wallet/useCashu'; import { useUsdToSats } from '@/hooks/useExchangeRate'; import { useToast } from '@/hooks/useToast'; import { useNostrPublish } from '@/hooks/useNostrPublish'; @@ -84,15 +83,11 @@ export function MarketplaceItemCard({ item, compact = false }: MarketplaceItemCa // Fetch trust score const { data: trustScore } = useTrustScore(item.pubkey); - // Cashu wallet integration - const { totalBalance: cashuBalance, coco } = useCashu(); - const [showPaymentDialog, setShowPaymentDialog] = useState(false); const [showReportDialog, setShowReportDialog] = useState(false); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [reportReason, setReportReason] = useState(''); const [reportDetails, setReportDetails] = useState(''); const [isReporting, setIsReporting] = useState(false); - const [isPaying, setIsPaying] = useState(false); // Format price display const priceDisplay = item.price @@ -141,27 +136,6 @@ export function MarketplaceItemCard({ item, compact = false }: MarketplaceItemCa const reportCount = reportData?.count || 0; const shouldHide = reportData?.shouldHide || false; - const handleCashuPayment = async () => { - if (!coco || !user) return; - - setIsPaying(true); - try { - toast({ - title: 'Payment Feature Coming Soon', - description: `Cashu peer-to-peer payments will be available soon! For now, please contact the seller directly.`, - }); - setShowPaymentDialog(false); - } catch (error) { - toast({ - variant: 'destructive', - title: 'Payment Failed', - description: error instanceof Error ? error.message : 'Failed to process payment', - }); - } finally { - setIsPaying(false); - } - }; - const handleReport = async () => { if (!user || !reportReason) { toast({ title: 'Please select a reason', variant: 'destructive' }); @@ -306,6 +280,11 @@ export function MarketplaceItemCard({ item, compact = false }: MarketplaceItemCa {priceTypeLabel && priceTypeLabel !== 'Fixed Price' && (
{priceTypeLabel}
)} + {priceInSats > 0 && ( +
+ ≈ {priceInSats.toLocaleString()} sats +
+ )} {/* Actions dropdown */} @@ -501,72 +480,6 @@ export function MarketplaceItemCard({ item, compact = false }: MarketplaceItemCa - {/* Payment Confirmation Dialog */} - - - - Confirm Payment - Review the payment details before confirming - - -
- {/* Item details */} -
- {primaryImage && ( - - )} -
-

{item.title}

-

Sold by {displayName}

-
-
- - {/* Payment details */} -
-
- Price: - {priceDisplay} -
-
- Amount (sats): - {priceInSats.toLocaleString()} sats -
-
- Your Cashu Balance: - {cashuBalance.toLocaleString()} sats -
-
- After Payment: - {(cashuBalance - priceInSats).toLocaleString()} sats -
-
- - - -

- ⚠️ Peer-to-peer payments are coming soon! This feature will allow - you to send Cashu tokens directly to the seller. For now, please contact the seller - to arrange payment. -

-
-
- -
- - -
-
-
-
- {/* Delete confirmation (controlled — trigger lives in the owner dropdown) */}