PageSourceSearch

https://bluerevolution-cc.manus.space/assets/Forum-CiVO91ro.js

js bluerevolution-cc.manus.space collected 2026-10-03 05:00:50 UTC 9,454 bytes, 1 lines download raw bytes

1import{j as e}from"./editor-BhGk7_S1.js";import{B as t}from"./button-CK76V7Lo.js";import{C as N,a as M,b as A,d as v}from"./card-CaSmhJ1l.js";import{I as B}from"./input-BtSXPsMX.js";import{R as z}from"./RichTextEditor-CU8s82Az.js";import{u as E,d as I,b as y,t as f,L as w}from"./index-BjIHAQhU.js";import{b as c}from"./leaflet-DcfcX7a_.js";import{A as U}from"./arrow-left-DCV3pRgt.js";import{P as k}from"./plus-cTouNM34.js";import{M as C}from"./message-square-QRsypMbA.js";import"./mapbox-BPFQ-Sfv.js";import"./dialog-DDbhAKMR.js";import"./index-CmmlU_cv.js";import"./x-rm1_-8OE.js";import"./palette-DTyCI4bH.js";import"./trpc-DqtxhgQo.js";function se(){const{t:a}=E(),[,T]=I(),[b,l]=c.useState(!1),[m,d]=c.useState(""),o=c.useRef(null),[r,u]=c.useState("recent"),[P,j]=c.useState(1),{data:x,isLoading:R,refetch:L}=y.forum.listTopics.useQuery({sortBy:r,page:P}),p=x?.topics,i=x?.totalPages||1,g=x?.currentPage||1,h=y.forum.createTopic.useMutation({onSuccess:s=>{f.success(a("common.success")),l(!1),d(""),o.current?.clear(),L(),T(`/forum/${s.topicId}`)},onError:s=>{f.error(s.message)}}),S=()=>{const s=o.current?.getContent()||"";if(!m.trim()||!s.trim()){f.error("Please fill in all fields");return}h.mutate({title:m,content:s})},F=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:63",className:"min-h-screen bg-background text-foreground",children:[e.jsx("div",{"data-loc":"client/src/pages/Forum.tsx:64",className:"starfield"}),e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:66",className:"relative z-10",children:[e.jsx("header",{"data-loc":"client/src/pages/Forum.tsx:68",className:"border-b border-border bg-card/50 backdrop-blur-sm",children:e.jsx("div",{"data-loc":"client/src/pages/Forum.tsx:69",className:"container py-3 md:py-6",children:e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:70",className:"flex items-center justify-between gap-2",children:[e.jsx(w,{"data-loc":"client/src/pages/Forum.tsx:71",href:"/",children:e.jsxs(t,{"data-loc":"client/src/pages/Forum.tsx:72",variant:"ghost",className:"gap-1 md:gap-2 text-xs md:text-sm px-2 md:px-4",children:[e.jsx(U,{"data-loc":"client/src/pages/Forum.tsx:73",className:"w-3 h-3 md:w-4 md:h-4"}),e.jsx("span",{"data-loc":"client/src/pages/Forum.tsx:74",className:"hidden sm:inline",children:a("dashboard.backToMap")}),e.jsx("span",{"data-loc":"client/src/pages/Forum.tsx:75",className:"sm:hidden",children:"Back"})]})}),e.jsx("h1",{"data-loc":"client/src/pages/Forum.tsx:78",className:"text-lg md:text-2xl font-bold text-gradient-blue",children:a("forum.title")}),e.jsx("div",{"data-loc":"client/src/pages/Forum.tsx:81",className:"w-16 md:w-24"})]})})}),e.jsx("main",{"data-loc":"client/src/pages/Forum.tsx:87",className:"container py-8 md:py-12",children:e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:88",className:"max-w-4xl mx-auto space-y-6",children:[!b&&e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:91",className:"flex justify-between items-center gap-4 flex-wrap",children:[e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:93",className:"flex gap-2",children:[e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:94",variant:r==="recent"?"default":"outline",size:"sm",onClick:()=>u("recent"),className:r==="recent"?"bg-blue-500 hover:bg-blue-600":"",children:a("forum.mostRecent")}),e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:102",variant:r==="active"?"default":"outline",size:"sm",onClick:()=>u("active"),className:r==="active"?"bg-blue-500 hover:bg-blue-600":"",children:a("forum.mostActive")}),e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:110",variant:r==="replies"?"default":"outline",size:"sm",onClick:()=>u("replies"),className:r==="replies"?"bg-blue-500 hover:bg-blue-600":"",children:a("forum.mostReplies")})]}),e.jsxs(t,{"data-loc":"client/src/pages/Forum.tsx:121",onClick:()=>l(!0),className:"gap-2 bg-blue-500 hover:bg-blue-600",children:[e.jsx(k,{"data-loc":"client/src/pages/Forum.tsx:125",className:"w-4 h-4"}),a("forum.newTopic")]})]}),b&&e.jsxs(N,{"data-loc":"client/src/pages/Forum.tsx:133",className:"bg-card/80 backdrop-blur-sm border-border",children:[e.jsx(M,{"data-loc":"client/src/pages/Forum.tsx:134",children:e.jsx(A,{"data-loc":"client/src/pages/Forum.tsx:135",className:"text-gradient-blue",children:a("forum.createTopic")})}),e.jsxs(v,{"data-loc":"client/src/pages/Forum.tsx:137",className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:138",children:[e.jsx("label",{"data-loc":"client/src/pages/Forum.tsx:139",className:"text-sm font-medium mb-2 block",children:a("forum.topicTitle")}),e.jsx(B,{"data-loc":"client/src/pages/Forum.tsx:140",value:m,onChange:s=>d(s.target.value),placeholder:a("forum.enterTitle"),maxLength:255,className:"bg-background/50"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:148",children:[e.jsx("label",{"data-loc":"client/src/pages/Forum.tsx:149",className:"text-sm font-medium mb-2 block",children:a("forum.topicMessage")}),e.jsx(z,{"data-loc":"client/src/pages/Forum.tsx:150",ref:o,placeholder:a("forum.writeMessage"),className:"bg-background/50"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:156",className:"flex gap-2 justify-end",children:[e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:157",variant:"outline",onClick:()=>{l(!1),d(""),o.current?.clear()},children:a("forum.cancel")}),e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:167",onClick:S,disabled:h.isPending,className:"bg-blue-500 hover:bg-blue-600",children:h.isPending?a("forum.loading"):a("forum.create")})]})]})]}),R?e.jsx("div",{"data-loc":"client/src/pages/Forum.tsx:181",className:"text-center py-12",children:e.jsx("p",{"data-loc":"client/src/pages/Forum.tsx:182",className:"text-muted-foreground",children:a("forum.loading")})}):p&&p.length>0?e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:185",className:"space-y-0",children:[p.map(s=>e.jsx(w,{"data-loc":"client/src/pages/Forum.tsx:187",href:`/forum/${s.id}`,children:e.jsx("div",{"data-loc":"client/src/pages/Forum.tsx:188",className:"border-b border-border hover:bg-blue-500/10 transition-colors cursor-pointer py-3 px-2",children:e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:189",className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:190",className:"flex-1 min-w-0",children:[e.jsxs("h3",{"data-loc":"client/src/pages/Forum.tsx:191",className:"text-lg font-semibold text-foreground mb-2 truncate flex items-center gap-2",children:[s.isPinned&&e.jsx("span",{"data-loc":"client/src/pages/Forum.tsx:192",className:"text-blue-500",children:"📌"}),s.title]}),e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:195",className:"flex items-center gap-4 text-sm text-muted-foreground mb-1",children:[e.jsxs("span",{"data-loc":"client/src/pages/Forum.tsx:196",children:["By ",e.jsxs("span",{"data-loc":"client/src/pages/Forum.tsx:197",className:"text-blue-400 hover:text-blue-300 cursor-pointer",onClick:n=>{n.stopPropagation(),window.location.href=`/profile/${s.userId}`},children:[s.userFirstName," ",s.userLastName]})]}),e.jsx("span",{"data-loc":"client/src/pages/Forum.tsx:207",children:"•"}),e.jsx("span",{"data-loc":"client/src/pages/Forum.tsx:208",children:F(s.createdAt)})]}),s.lastActivityAt&&s.lastReplyUserFirstName&&e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:212",className:"text-xs text-muted-foreground
1/80 italic",children:[a("forum.lastReplyBy")," ",e.jsxs("span",{"data-loc":"client/src/pages/Forum.tsx:213",className:"text-blue-400 hover:text-blue-300 cursor-pointer",onClick:n=>{n.stopPropagation(),window.location.href=`/profile/${s.lastReplyUserId}`},children:[s.lastReplyUserFirstName," ",s.lastReplyUserLastName]})," - ",F(s.lastActivityAt)]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:225",className:"flex items-center gap-2 text-sm text-muted-foreground flex-shrink-0",children:[e.jsx(C,{"data-loc":"client/src/pages/Forum.tsx:226",className:"w-4 h-4"}),e.jsx("span",{"data-loc":"client/src/pages/Forum.tsx:227",children:s.messageCount})]})]})})},s.id)),i>1&&e.jsxs("div",{"data-loc":"client/src/pages/Forum.tsx:236",className:"flex justify-center items-center gap-4 mt-8",children:[e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:237",variant:"outline",size:"sm",onClick:()=>j(s=>Math.max(1,s-1)),disabled:g===1,children:a("forum.previous")}),e.jsxs("span",{"data-loc":"client/src/pages/Forum.tsx:245",className:"text-sm text-muted-foreground",children:[a("forum.page")," ",g," / ",i]}),e.jsx(t,{"data-loc":"client/src/pages/Forum.tsx:248",variant:"outline",size:"sm",onClick:()=>j(s=>Math.min(i,s+1)),disabled:g===i,children:a("forum.next")})]})]}):e.jsx(N,{"data-loc":"client/src/pages/Forum.tsx:260",className:"bg-card/80 backdrop-blur-sm border-border",children:e.jsxs(v,{"data-loc":"client/src/pages/Forum.tsx:261",className:"py-12 text-center",children:[e.jsx(C,{"data-loc":"client/src/pages/Forum.tsx:262",className:"w-12 h-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("p",{"data-loc":"client/src/pages/Forum.tsx:263",className:"text-muted-foreground mb-4",children:a("forum.noTopics")}),e.jsxs(t,{"data-loc":"client/src/pages/Forum.tsx:266",onClick:()=>l(!0),className:"gap-2 bg-blue-500 hover:bg-blue-600",children:[e.jsx(k,{"data-loc":"client/src/pages/Forum.tsx:270",className:"w-4 h-4"}),a("forum.create")]})]})})]})})]})]})}export{se as default};

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.