veza/apps/web/dist_verification/assets/SocialPage-DguJum4V.js

1 line
8.5 KiB
JavaScript

import{a as n,j as e}from"./vendor-react-BHG7lGYR.js";import{g as j,B as r,l as f}from"./index-BWcMVITa.js";import{X as N,ai as b,ao as k,b3 as w,a6 as y,b4 as C,F as m,af as P,O as u,aM as S,aS as F}from"./vendor-icons-DaGlTw4_.js";import{s as M}from"./socialService-is9ldyAe.js";import"./vendor-IYr-MHu4.js";import"./vendor-router-D-s5vIeO.js";import"./vendor-tanstack-BzWBL1hV.js";import"./vendor-utils-CgOSfOkx.js";const z=({onClose:o,onCreate:h})=>{const i=j(),[l,d]=n.useState(""),[s,t]=n.useState("public"),[c,x]=n.useState("text"),p=()=>{l&&(h({content:l,visibility:s,type:c}),o())},g=a=>{d(v=>`${v} #${a} `)};return e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-kodo-void/90 backdrop-blur-sm",onClick:o}),e.jsxs("div",{className:"relative w-full max-w-lg bg-kodo-graphite border border-kodo-steel rounded-xl shadow-2xl animate-scaleIn overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-kodo-steel bg-kodo-ink flex justify-between items-center",children:[e.jsx("h3",{className:"font-bold text-white",children:"Create Post"}),e.jsx("button",{onClick:o,children:e.jsx(N,{className:"w-5 h-5 text-kodo-content-dim hover:text-white"})})]}),e.jsxs("div",{className:"p-4 flex-1",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-kodo-steel overflow-hidden flex-shrink-0",children:e.jsx("img",{src:"https://picsum.photos/id/237/100/100",className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"mb-2",children:e.jsxs("select",{className:"bg-kodo-ink border border-kodo-steel rounded px-2 py-1 text-xs text-kodo-steel focus:outline-none cursor-pointer",value:s,onChange:a=>t(a.target.value),children:[e.jsx("option",{value:"public",children:"Public"}),e.jsx("option",{value:"followers",children:"Followers Only"}),e.jsx("option",{value:"private",children:"Private Draft"})]})}),e.jsx("textarea",{className:"w-full bg-transparent border-none text-white placeholder-gray-500 focus:ring-0 resize-none h-32 text-base",placeholder:"What's happening in your studio?",value:l,onChange:a=>d(a.target.value),autoFocus:!0})]})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs",children:[e.jsxs("span",{className:"text-kodo-content-dim flex items-center gap-1",children:[e.jsx(b,{className:"w-3 h-3"})," Trending:"]}),["Synthwave","NewGear","StudioLife","WIP"].map(a=>e.jsxs("button",{onClick:()=>g(a),className:"text-kodo-cyan hover:underline",children:["#",a]},a))]})]}),e.jsxs("div",{className:"p-4 border-t border-kodo-steel bg-kodo-ink flex justify-between items-center",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{className:`p-2 rounded hover:bg-white/10 text-kodo-content-dim hover:text-white ${c==="image"?"text-kodo-steel":""}`,onClick:()=>{x("image"),i.info("Image upload simulated")},title:"Photo",children:e.jsx(k,{className:"w-5 h-5"})}),e.jsx("button",{className:"p-2 rounded hover:bg-white/10 text-kodo-content-dim hover:text-kodo-magenta",onClick:()=>{x("video"),i.info("Video upload simulated")},title:"Video",children:e.jsx(w,{className:"w-5 h-5"})}),e.jsx("button",{className:"p-2 rounded hover:bg-white/10 text-kodo-content-dim hover:text-kodo-lime",onClick:()=>{x("audio"),i.info("Audio upload simulated")},title:"Audio",children:e.jsx(y,{className:"w-5 h-5"})}),e.jsx("button",{className:"p-2 rounded hover:bg-white/10 text-kodo-content-dim hover:text-kodo-gold",onClick:()=>{x("poll"),i.info("Poll creator simulated")},title:"Poll",children:e.jsx(C,{className:"w-5 h-5"})})]}),e.jsx(r,{variant:"primary",onClick:p,disabled:!l,children:"Post"})]})]})]})};function U(){const o=j(),[h,i]=n.useState(!1),[l,d]=n.useState([{id:1,author:"DJ Nova",avatar:"🎧",content:"Just dropped a new track! Check it out on my profile.",likes:42,comments:8,timestamp:"2h ago"},{id:2,author:"Producer Mike",avatar:"🎹",content:"Working on a collaboration with some amazing artists. Stay tuned!",likes:28,comments:5,timestamp:"4h ago"}]);return e.jsxs("div",{className:"min-h-screen p-8 space-y-8",children:[e.jsx("div",{className:"glass-hud rounded-2xl border-white/10 p-8 hud-corner",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-kodo-steel/20 flex items-center justify-center border border-kodo-steel/30",children:e.jsx(m,{className:"w-6 h-6 text-kodo-steel"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-white",children:"Community Feed"}),e.jsx("p",{className:"text-sm text-kodo-secondary",children:"Connect with artists worldwide"})]})]}),e.jsx(r,{className:"bg-kodo-cyan hover:bg-kodo-cyan/80 text-black",onClick:()=>i(!0),children:"Create Post"})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx("div",{className:"glass-hud rounded-xl border-white/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(P,{className:"w-5 h-5 text-kodo-lime"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-kodo-secondary",children:"Trending"}),e.jsx("p",{className:"text-lg font-bold text-white",children:"156 Posts"})]})]})}),e.jsx("div",{className:"glass-hud rounded-xl border-white/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(m,{className:"w-5 h-5 text-kodo-steel"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-kodo-secondary",children:"Following"}),e.jsx("p",{className:"text-lg font-bold text-white",children:"42 Artists"})]})]})}),e.jsx("div",{className:"glass-hud rounded-xl border-white/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(u,{className:"w-5 h-5 text-kodo-magenta"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-kodo-secondary",children:"Likes"}),e.jsx("p",{className:"text-lg font-bold text-white",children:"1.2K Total"})]})]})})]}),e.jsx("div",{className:"space-y-4",children:l.map(s=>e.jsx("div",{className:"glass-hud rounded-xl border-white/10 p-8 hud-corner",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-kodo-graphite border border-white/10 flex items-center justify-center text-2xl",children:s.avatar}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white",children:typeof s.author=="string"?s.author:s.author?.name||"Unknown"}),e.jsx("p",{className:"text-xs text-kodo-secondary",children:s.timestamp})]})}),e.jsx("p",{className:"text-white mb-4",children:s.content}),e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>o.info("Like feature coming soon"),className:"text-kodo-secondary hover:text-kodo-magenta",children:[e.jsx(u,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:s.likes})]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>o.info("Comment feature coming soon"),className:"text-kodo-secondary hover:text-white",children:[e.jsx(S,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:s.comments})]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>o.info("Share feature coming soon"),className:"text-kodo-secondary hover:text-white",children:[e.jsx(F,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:"Share"})]})]})]})]})},s.id))}),e.jsxs("div",{className:"glass-hud rounded-xl border-white/10 p-12 text-center",children:[e.jsx(m,{className:"w-16 h-16 text-kodo-secondary mx-auto mb-4 opacity-50"}),e.jsx("h3",{className:"text-lg font-bold text-white mb-2",children:"Start Following Artists"}),e.jsx("p",{className:"text-kodo-secondary mb-4",children:"Follow artists to see their latest updates in your feed"}),e.jsx(r,{onClick:()=>o.info("Discover artists feature coming soon"),variant:"outline",className:"border-kodo-steel/50 text-kodo-steel hover:bg-white/5",children:"Discover Artists"})]}),h&&e.jsx(z,{onClose:()=>i(!1),onCreate:async s=>{try{const t=await M.createPost({content:s.content,attachments:s.type!=="text"?{type:s.type}:void 0}),c={...t.post,author:typeof t.post.author=="string"?t.post.author:t.post.author?.name||"Me"};d([c,...l]),o.success("Post published successfully"),i(!1)}catch(t){f.error("Failed to create post",{error:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0}),o.error("Failed to create post. Please try again.")}}})]})}export{U as SocialPage};