import React, { useCallback, useMemo, useState } from 'react'; import { useAppStateContext } from '../context/user.data.context'; import Button from '../components/widgets/Button'; const AgenticFeedPage = () => { const { clientId, user } = useAppStateContext(); const [isCopied, setIsCopied] = useState(false); const isReady = user?.feed_status === 'COMPLETED'; const feedUrl = useMemo(() => { if (!clientId) return ''; return `https://storage.googleapis.com/feeds-recomaze/openai/${clientId}/openai_product_feed_v1.csv`; }, [clientId]); const prettyUrl = useMemo(() => { if (!feedUrl) return ''; try { const u = new URL(feedUrl); const parts = u.pathname.split('/').filter(Boolean); const tail = parts.slice(-1)[0] ?? ''; return `${u.host}/…/${tail}`; } catch { return feedUrl; } }, [feedUrl]); const copy = useCallback(async () => { if (!feedUrl) return; try { await navigator.clipboard.writeText(feedUrl); setIsCopied(true); setTimeout(() => setIsCopied(false), 2000); } catch { const ta = document.createElement('textarea'); ta.value = feedUrl; document.body.appendChild(ta); ta.select(); try { document.execCommand('copy'); setIsCopied(true); setTimeout(() => setIsCopied(false), 2000); } finally { document.body.removeChild(ta); } } }, [feedUrl]); return (
Your product catalog is automatically formatted to meet the{' '} OpenAI Commerce Feed Specification .
Use this secure link to connect your store to ChatGPT Shopping.
{isReady ? prettyUrl : 'Processing feed generation...'}