diff --git a/src/modules/nostr-feed/components/MarketProduct.vue b/src/modules/nostr-feed/components/MarketProduct.vue new file mode 100644 index 0000000..e80b842 --- /dev/null +++ b/src/modules/nostr-feed/components/MarketProduct.vue @@ -0,0 +1,171 @@ + + + + + \ No newline at end of file diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue index a4a04f9..5472ffe 100644 --- a/src/modules/nostr-feed/components/NostrFeed.vue +++ b/src/modules/nostr-feed/components/NostrFeed.vue @@ -9,6 +9,8 @@ import { Megaphone, RefreshCw, AlertCircle } from 'lucide-vue-next' import { useFeed } from '../composables/useFeed' import appConfig from '@/app.config' import type { ContentFilter } from '../services/FeedService' +import MarketProduct from './MarketProduct.vue' +import { parseMarketProduct, isMarketEvent, getMarketEventType } from '../utils/marketParser' const props = defineProps<{ relays?: string[] @@ -62,6 +64,34 @@ const feedDescription = computed(() => { function isAdminPost(pubkey: string): boolean { return adminPubkeys.includes(pubkey) } + +// Get market product data for market events +function getMarketProductData(note: any) { + if (note.kind === 30018) { + // Create a mock NostrEvent from our FeedPost + const mockEvent = { + id: note.id, + pubkey: note.pubkey, + content: note.content, + created_at: note.created_at, + kind: note.kind, + tags: note.tags + } + return parseMarketProduct(mockEvent) + } + return null +} + +// Handle market product actions +function onViewProduct(productId: string) { + console.log('View product:', productId) + // TODO: Navigate to product detail page or open modal +} + +function onShareProduct(productId: string) { + console.log('Share product:', productId) + // TODO: Implement sharing functionality +}