import{r as u,j as e}from"./app-BwDemWQz.js";import{P as v}from"./PlatformIcon-BoGOJKWv.js";import{u as j}from"./LanguageContext-zkEAKPTE.js";import{a as f,b as y,c as N}from"./AppLayout-3zbhnyYw.js";const A=({data:i={}})=>{const[a,n]=u.useState("Post"),{posts:d=[]}=i,m=j(),t=d.filter(s=>s.type===a.toLowerCase()),x=["Post","Reels","Story"];return e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-lg p-6 shadow-sm border border-gray-200 dark:border-zinc-800",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:m("All Content")}),e.jsx("div",{className:"flex space-x-1",children:x.map(s=>e.jsx("button",{onClick:()=>n(s),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${a===s?"bg-gradient-to-r from-primary to-secondary hover:bg-gradient-to-r hover:from-secondary hover:to-primary text-white":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-zinc-800"}`,children:s},s))})]}),e.jsxs("div",{className:"min-h-[300px]",children:[e.jsx("div",{className:"space-y-4",children:t.map((s,o)=>{var l,c;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:space-x-4 space-y-4 md:space-y-0 py-4",children:[e.jsxs("div",{className:"flex items-center space-x-3 flex-shrink-0 w-full md:w-[300px]",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs(f,{className:"h-10 w-10",children:[e.jsx(y,{src:(l=s==null?void 0:s.account)==null?void 0:l.avatar,alt:"User Avatar"}),e.jsx(N,{children:"AV"})]}),e.jsx("div",{className:"absolute -bottom-1 -right-1 w-5 h-5 bg-white dark:bg-zinc-900 rounded-full flex items-center justify-center text-xs",children:e.jsx(v,{slug:(c=s.platform)==null?void 0:c.slug,size:14,round:!0})})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:s.author}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:s.timestamp}),e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 truncate flex-1",children:s.content})})]}),e.jsx("div",{className:"flex-1 flex items-center min-w-0",children:s.media&&s.media.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[s.media.slice(0,1).map(r=>r.isVideo?e.jsx("video",{src:r.thumbnail||"/placeholder.mp4",className:"w-16 h-12 rounded object-cover",muted:!0,playsInline:!0,loop:!0,autoPlay:!0},r.id):e.jsx("img",{src:r.url||"/placeholder.svg",alt:r.alt||"Post thumbnail",className:"w-28 h-16 rounded object-cover"},r.id)),s.media.length>1&&e.jsxs("span",{className:"text-xs font-semibold text-gray-700 dark:text-gray-300 ml-1",children:["+",s.media.length-1]})]})})]}),e.jsx("div",{className:"flex-1 w-full",children:e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-9 gap-4",children:[["Impression",s.metrics.impression],["Engagement",s.metrics.engagement],["Clicks",s.metrics.clicks],["Shares",s.metrics.shares],["Comments",s.metrics.comments],["Conversions",s.metrics.conversions],["Bounce Rate",s.metrics.bounceRate],["New Followers",s.metrics.newFollowers],["Revenue",s.metrics.revenue]].map(([r,h],g)=>e.jsxs("div",{className:"text-start",children:[e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:r}),e.jsx("p",{className:"font-medium text-gray-900 dark:text-white text-sm",children:h})]},g))})})]}),o<t.length-1&&e.jsx("div",{className:"border-b border-gray-200 dark:border-zinc-800"})]},s.id)})}),t.length===0&&e.jsx("div",{className:"text-center py-16",children:e.jsxs("p",{className:"text-gray-500 dark:text-gray-400",children:["No ",a.toLowerCase()," content found"]})})]})]})};export{A};
