1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[289],{3903:(e,t,r)=>{Promise.resolve().then(r.bind(r,8734))},8734:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var s=r(5155),i=r(2115);let o=async()=>{try{let e=await fetch("/api/tiktok?type=trending");if(!e.ok)throw Error("Failed to fetch trending prompts: ".concat(e.statusText));return(await e.json()).prompts||[]}catch(e){return console.error("Error fetching trending prompts:",e),[]}};var a=r(2164),n=r(2105),l=r(1788),c=r(8158);let d=(e,t)=>"".concat(e,"-").concat(t);function p(){let{toast:e}=(0,a.d)(),[t,r]=(0,i.useState)([]),[p,m]=(0,i.useState)(!0),[h,f]=(0,i.useState)(new Set);(0,i.useEffect)(()=>{f(new Set((0,c.tm)())),x()},[]);let x=async()=>{m(!0);try{let t=await o();r(t),0===t.length&&e({title:"No prompts found",description:"No AI prompts were found in trending TikTok videos."})}catch(t){console.error("Error fetching trending prompts:",t),e({title:"Error",description:"Failed to fetch TikTok prompts. Please try again.",variant:"destructive"})}finally{m(!1)}},u=async t=>{try{h.has(t.id)?((0,c.N4)(t.id),f(e=>{let r=new Set(e);return r.delete(t.id),r}),e({title:"Prompt unsaved",description:"The prompt has been removed from your saved prompts"})):((0,c.uH)(t.id),f(e=>new Set([...e,t.id])),e({title:"Prompt saved",description:"The prompt has been added to your saved prompts"}))}catch(t){console.error("Error saving prompt:",t),e({title:"Error",description:"Failed to save the prompt. Please try again.",variant:"destructive"})}},v=t.map((e,t)=>({id:d("tiktok",t),title:e.creativeTitle||e.prompt.slice(0,50)+"...",description:"AI prompt from TikTok video by ".concat(e.author),promptText:e.prompt,category:"TikTok",tags:["tiktok","ai","prompt"],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),severity:"low"}));return(0,s.jsxs)("div",{className:"flex flex-col h-screen",children:[(0,s.jsx)(n.A,{}),(0,s.jsx)("main",{className:"flex-1 bg-gray-50 overflow-hidden",children:(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsx)("div",{className:"py-3",children:(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)("div",{className:"px-4 py-1",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,s.jsx)("span",{className:"text-sm text-black",children:"TikTok AI Prompts"}),(0,s.jsx)("div",{className:"h-0.5 bg-rose-300 rounded-full mt-1 w-12"})]})})})}),(0,s.jsx)("div",{className:"flex-1 px-2 overflow-auto",children:p?(0,s.jsx)("div",{className:"flex justify-center items-center py-20",children:(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500"})}):0===v.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-20",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold mb-2 text-gray-800",children:"Prompt feed is still warming up"}),(0,s.jsx)("p",{className:"text-gray-500 max-w-md text-center",children:"We're building the pipeline that turns TikTok AI content into clean, usable prompts. Sometimes the trending data doesn't cooperate â or the content just isn't great yet. Check back soon or refresh to try again."})]}):(0,s.jsx)(l.A,{prompts:v,onSave:u,savedPromptIds:h})})]})})]})}}},e=>{var t=t=>e(e.s=t);e.O(0,[294,702,874,138,185,441,684,358],()=>t(3903)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.