Bloc A - Code mort: - Suppression Studio (components, views, features) - Suppression gamification + services mock (projectService, storageService, gamificationService) - Mise à jour Sidebar, Navbar, locales Bloc B - Frontend: - Suppression modal.tsx deprecated, Modal.stories (doublon Dialog) - Feature flags: PLAYLIST_SEARCH, PLAYLIST_RECOMMENDATIONS, ROLE_MANAGEMENT = true - Suppression 19 tests orphelins, retrait exclusions vitest.config Bloc C - Backend: - Extraction routes_auth.go depuis router.go Bloc D - Rust: - Suppression security_legacy.rs (code mort, patterns déjà dans security/)
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
import{a as x,j as e}from"./vendor-react-yWUy5XPk.js";import{g as v,u as E,B as m,C as f,k as L,S as n,i as M}from"./index-CYK_b1Uz.js";import{ai as A,U as T,Y as I,aj as R,ak as V,o as D,F as w,af as F,al as B}from"./vendor-icons-DJFb1Tiw.js";import{m as j}from"./vendor-motion-B3XPS3Jc.js";import"./vendor-CveO81sn.js";import"./vendor-security-DsrNJhpn.js";import"./vendor-router-BNNHboN9.js";import"./vendor-tanstack-kPY9uK0s.js";import"./vendor-http-Cz8wfb0q.js";import"./vendor-utils-DtoSyhX2.js";import"./vendor-i18n-CMcqpBLz.js";const h={id:"1",title:"Late Night DnB Production 🎧 | Feedback Session",streamer:"Neuro_Glitch",viewers:1240,thumbnailUrl:"https://picsum.photos/id/140/800/450",tags:["Production","Ableton","DnB"],isLive:!0,category:"Production"},P=[{user:"BassHead99",text:"That Reese bass is filthy! 🤮🔥",color:"text-muted-foreground"},{user:"Studio_Rat",text:"What VST is that?",color:"text-muted-foreground"},{user:"Neuro_Glitch",text:"It's Phase Plant, just initializing now.",color:"text-warning font-bold"},{user:"VocalChops",text:"Sent a $5 dono! Check my track?",color:"text-success"}];function N(s){const a=s.tags;return{id:String(s.id??""),title:String(s.title??""),streamer:String(s.streamer??s.streamerName??""),viewers:Number(s.viewers??s.viewerCount??0),thumbnailUrl:String(s.thumbnailUrl??""),tags:Array.isArray(a)?a:[],isLive:!!(s.isLive??s.is_live??!1),category:s.category??"Production"}}const b={async listStreams(s){const a=s!=null?{is_live:String(s)}:{},r=(await v.get("/live/streams",{params:a})).data?.streams??[];return Array.isArray(r)?r.map(N):[]},async getStream(s){const l=(await v.get(`/live/streams/${s}`)).data?.stream;return l?N(l):null}};function U(s={}){const{addToast:a}=E(),[l,r]=x.useState(s.stream??h),[o,t]=x.useState(!1),[u,i]=x.useState(null),g=s.chatMessages??P,[c,p]=x.useState("");x.useEffect(()=>{if(s.stream!==void 0&&s.stream!==null){r(s.stream),t(!1),i(null);return}if(s.stream===null){r(h);return}t(!0),i(null),(s.streamId?b.getStream(s.streamId):b.listStreams(!0).then(d=>d[0]??void 0)).then(d=>r(d??h)).catch(d=>{i(d instanceof Error?d:new Error(String(d))),r(h)}).finally(()=>t(!1))},[s.stream,s.streamId]);const y=x.useCallback(()=>{c.trim()&&(s.onSendMessage?s.onSendMessage(c):a("Message sent to chat","success"),p(""))},[c,s.onSendMessage,a]),S=l??h,k=s.isLoading??o,C=s.error??u;return{stream:S,chatMessages:g,msgInput:c,setMsgInput:p,handleSend:y,addToast:a,isLoading:k,error:C}}function _({stream:s,onToggleChat:a,onSettings:l,onFullscreen:r}){return e.jsxs("div",{className:"relative aspect-video bg-black rounded-xl overflow-hidden shadow-2xl border border-border group",children:[e.jsx("img",{src:s.thumbnailUrl,alt:"",className:"w-full h-full object-cover opacity-80"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent"}),e.jsxs("div",{className:"absolute top-4 left-4 flex gap-2",children:[e.jsxs("span",{className:"bg-destructive text-destructive-foreground px-2 py-1 text-xs font-bold rounded flex items-center gap-1 animate-pulse",children:[e.jsx(A,{className:"w-3 h-3"})," LIVE"]}),e.jsxs("span",{className:"bg-black/50 backdrop-blur text-foreground px-2 py-1 text-xs font-mono rounded flex items-center gap-1",children:[e.jsx(T,{className:"w-3 h-3"})," ",s.viewers]})]}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 flex justify-between items-end opacity-0 group-hover:opacity-100 transition-opacity duration-[var(--sumi-duration-normal)]",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx(m,{variant:"ghost",size:"sm",className:"text-foreground hover:bg-white/10",onClick:a,children:e.jsx(I,{className:"w-5 h-5"})}),e.jsx(m,{variant:"ghost",size:"sm",className:"text-foreground hover:bg-white/10",onClick:l,children:e.jsx(R,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex gap-4",children:e.jsx(m,{variant:"ghost",size:"sm",className:"text-foreground hover:bg-white/10",onClick:r,children:e.jsx(V,{className:"w-5 h-5"})})})]})]})}function z({stream:s,onStreamerClick:a,onFollow:l,onDonate:r,onShare:o}){return e.jsx(f,{variant:"glass",className:"p-6 border-white/5 bg-black/20 backdrop-blur-xl transition-shadow duration-[var(--sumi-duration-normal)]",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-neon p-0.5",children:e.jsx("img",{src:"https://picsum.photos/100/100",alt:"",className:"w-full h-full rounded-full object-cover border-2 border-border"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground tracking-tight",children:s.title}),e.jsx("p",{className:"text-primary font-medium cursor-pointer hover:underline",onClick:a,children:s.streamer}),e.jsx("div",{className:"flex gap-2 mt-2",children:s.tags.map(t=>e.jsx(L,{label:t,variant:"terminal"},t))})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(m,{variant:"secondary",icon:e.jsx(D,{className:"w-4 h-4"}),onClick:l,children:"FOLLOW"}),e.jsx(m,{variant:"primary",icon:e.jsx(w,{className:"w-4 h-4"}),onClick:r,children:"DONATE"}),e.jsx(m,{variant:"ghost",icon:e.jsx(F,{className:"w-4 h-4"}),onClick:o,children:"SHARE"})]})]})})}function H({onChannelClick:s}){return e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"font-bold text-muted-foreground mb-4 uppercase text-sm tracking-wider",children:"Recommended Channels"}),e.jsx(j.div,{className:"grid grid-cols-1 md:grid-cols-3 gap-4",initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.06}},hidden:{}},children:[1,2,3].map(a=>e.jsx(j.div,{variants:{hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},children:e.jsxs(f,{variant:"glass",className:"p-0 overflow-hidden group cursor-pointer border-white/5 bg-black/20 backdrop-blur-xl transition-all duration-[var(--sumi-duration-normal)]",onClick:()=>s?.(a),children:[e.jsxs("div",{className:"aspect-video relative",children:[e.jsx("img",{src:`https://picsum.photos/300/200?random=${a}`,alt:"",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute bottom-2 left-2 bg-background/80 px-2 py-0.5 rounded text-xs text-foreground",children:"DJ Set"})]}),e.jsxs("div",{className:"p-4 flex gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-bold text-sm text-foreground truncate tracking-tight",children:"Techno Bunker 24/7"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Underground_Radio"})]})]})]})},a))})]})}function O({messages:s,msgInput:a,onMsgInputChange:l,onSend:r,onWalletClick:o}){return e.jsxs(f,{variant:"glass",className:"lg:col-span-3 flex flex-col p-0 overflow-hidden h-full min-h-0 border-white/5 bg-black/20 backdrop-blur-xl transition-shadow duration-[var(--sumi-duration-normal)]",children:[e.jsxs("div",{className:"p-4 border-b border-border flex justify-between items-center bg-card",children:[e.jsx("span",{className:"font-mono text-sm font-bold text-foreground tracking-tight",children:"STREAM CHAT"}),e.jsx("div",{className:"w-2 h-2 bg-success rounded-full animate-pulse"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 font-mono text-sm",children:[s.map((t,u)=>e.jsxs("div",{className:"break-words",children:[e.jsxs("span",{className:`font-bold ${t.color} mr-2 cursor-pointer hover:underline`,children:[t.user,":"]}),e.jsx("span",{className:"text-foreground",children:t.text})]},u)),e.jsx("div",{className:"text-center py-2",children:e.jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded-full",children:"Welcome to the chat room!"})})]}),e.jsxs("div",{className:"p-4 bg-muted border-t border-border",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{value:a,onChange:t=>l(t.target.value),onKeyDown:t=>t.key==="Enter"&&r(),className:"w-full bg-background border border-border rounded-xl px-4 py-2 text-sm text-foreground focus:border-primary outline-none transition-colors duration-[var(--sumi-duration-normal)]",placeholder:"Say something..."}),e.jsx(w,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-warning cursor-pointer hover:opacity-80 transition-opacity"})]}),e.jsx(m,{variant:"primary",size:"sm",className:"px-4",onClick:r,children:e.jsx(B,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex justify-between mt-2 px-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Balance: 420 $VEZA"}),e.jsx("span",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground",onClick:o,children:"Get Coins"})]})]})]})}function W(){return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 min-h-layout-main animate-fadeIn",children:[e.jsxs("div",{className:"lg:col-span-9 flex flex-col gap-4",children:[e.jsx(n,{className:"aspect-video w-full rounded-xl"}),e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx(n,{className:"w-12 h-12 rounded-full shrink-0"}),e.jsxs("div",{className:"space-y-2 min-w-0",children:[e.jsx(n,{className:"h-8 w-3/4"}),e.jsx(n,{className:"h-4 w-32"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(n,{className:"h-5 w-16"}),e.jsx(n,{className:"h-5 w-20"}),e.jsx(n,{className:"h-5 w-14"})]})]})]}),e.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.jsx(n,{className:"h-10 w-24"}),e.jsx(n,{className:"h-10 w-24"}),e.jsx(n,{className:"h-10 w-20"})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx(n,{className:"h-4 w-48 mb-4"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[1,2,3].map(s=>e.jsx(n,{className:"aspect-video w-full rounded-xl"},s))})]})]}),e.jsxs("div",{className:"lg:col-span-3 flex flex-col min-h-0",children:[e.jsx(n,{className:"h-12 rounded-t-xl mb-4"}),e.jsx("div",{className:"flex-1 space-y-4",children:[1,2,3,4,5].map(s=>e.jsx(n,{className:"h-8 w-full"},s))}),e.jsx(n,{className:"h-24 rounded-b-xl mt-4"})]})]})}function re({stream:s,chatMessages:a}={}){const{stream:l,chatMessages:r,msgInput:o,setMsgInput:t,handleSend:u,addToast:i,isLoading:g,error:c}=U({stream:s??void 0,chatMessages:a});return g?e.jsx(W,{}):c?e.jsx("div",{className:"min-h-layout-main flex items-center justify-center p-6",children:e.jsx(M,{error:c,variant:"card"})}):e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 min-h-layout-main animate-fadeIn",children:[e.jsxs("div",{className:"lg:col-span-9 flex flex-col gap-4",children:[e.jsx(_,{stream:l,onToggleChat:()=>i("Chat hidden"),onSettings:()=>i("Stream Settings"),onFullscreen:()=>i("Entering Fullscreen")}),e.jsx(z,{stream:l,onStreamerClick:()=>i("Opening Streamer Profile"),onFollow:()=>i("Followed Streamer","success"),onDonate:()=>i("Donation modal opening...","info"),onShare:()=>i("Stream link copied!")}),e.jsx(H,{onChannelClick:()=>i("Switching stream...")})]}),e.jsx(O,{messages:r,msgInput:o,onMsgInputChange:t,onSend:u,onWalletClick:()=>i("Opening Wallet...")})]})}export{re as LiveView};
|