Files
Atomcms-edit/frontend/.next/static/chunks/11e6~7dio91wq.js
T
2026-05-09 17:32:17 +02:00

1 line
4.7 KiB
JavaScript
Executable File

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98282,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(57688),a=e.i(22016),d=e.i(88589),l=e.i(13642),n=e.i(9165);e.s(["default",0,function(){let[e,i]=(0,s.useState)([]),[c,o]=(0,s.useState)(!0),[x,m]=(0,s.useState)(null),[u,h]=(0,s.useState)(""),[g,p]=(0,s.useState)(!1);(0,s.useEffect)(()=>{async function e(){try{let{data:e,error:t}=await n.api.get("/radio/shouts");t?m(t):e&&i(e)}catch{m("Er is een fout opgetreden bij het laden van de berichten")}o(!1)}e();let t=setInterval(e,15e3);return()=>clearInterval(t)},[]);let f=async()=>{if(u.trim()){p(!0);try{let{data:e,error:t}=await n.api.post("/radio/shouts",{message:u});!t&&e&&(i(t=>[e,...t]),h(""))}catch{}p(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.default,{}),(0,t.jsx)("main",{className:"bg-background min-h-screen",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto p-4 lg:p-6",children:[(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-4 md:p-6 mb-6",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary flex items-center justify-center",children:(0,t.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl md:text-3xl font-bold text-text-main",children:"Live Berichten"}),(0,t.jsx)("p",{className:"text-text-muted",children:"Stuur berichten naar de DJ en andere luisteraars"})]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-6",children:[(0,t.jsx)(a.default,{href:"/community/radio",className:"px-4 py-2 rounded-lg bg-surface hover:bg-gray-100 transition-colors text-sm font-semibold text-text-muted",children:"Radio Home"}),(0,t.jsx)(a.default,{href:"/community/radio/rooster",className:"px-4 py-2 rounded-lg bg-surface hover:bg-gray-100 transition-colors text-sm font-semibold text-text-muted",children:"DJ Rooster"}),(0,t.jsx)(a.default,{href:"/community/radio/dj-aanmelden",className:"px-4 py-2 rounded-lg bg-surface hover:bg-gray-100 transition-colors text-sm font-semibold text-text-muted",children:"DJ worden"})]}),(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-4 md:p-6 mb-6",children:(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),placeholder:"Stuur een bericht...",className:"flex-1 px-3 py-2 rounded-lg border border-input-border bg-background text-text-main text-sm focus:outline-none focus:ring-2 focus:ring-primary",maxLength:200}),(0,t.jsx)("button",{onClick:f,disabled:g||!u.trim(),className:"px-4 py-2 rounded-lg bg-primary text-text-main font-semibold text-sm hover:bg-primary-hover transition-colors disabled:opacity-50",children:g?"...":"Verstuur"})]})}),c?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-text-muted",children:"Berichten laden..."})}):x?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-danger",children:x})}):e.length>0?(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card overflow-hidden",children:(0,t.jsx)("div",{className:"max-h-[600px] overflow-y-auto divide-y divide-gray-100",children:e.map(e=>(0,t.jsxs)("div",{className:"flex gap-3 p-4",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg overflow-hidden bg-background relative flex-shrink-0",children:(0,t.jsx)(r.default,{src:e.user.look?`https://epicnabbo.nl/imaging/?figure=${e.user.look}&headonly=1&direction=2`:"https://epicnabbo.nl/imaging/?figure=hr-893-45.hd-180-14.ch-210-30.lg-270-75.sh-290-75&headonly=1&direction=2",alt:e.user.username,fill:!0,className:"object-cover"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)(a.default,{href:`/profile/${e.user.username}`,className:"font-semibold text-primary hover:underline",children:e.user.username}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:new Date(e.created_at).toLocaleString("nl-NL")})]}),(0,t.jsx)("p",{className:"text-text-main mt-1 break-words",children:e.message})]})]},e.id))})}):(0,t.jsx)("div",{className:"bg-surface rounded-lg shadow-card p-8 text-center",children:(0,t.jsx)("p",{className:"text-text-muted",children:"Nog geen berichten. Wees de eerste!"})})]})}),(0,t.jsx)(l.default,{})]})}])}]);