PageSourceSearch

https://edgemxtiming.com/assets/OrgFeedPost-PuqCFvCB.js

js edgemxtiming.com collected 2026-10-02 01:30:30 UTC 4,217 bytes, 1 lines download raw bytes

1import{K as j,bo as b,bp as g,r as d,j as t,bq as N,L as k,B as v,d as w,m as C,n as L,l as R,u as P,s as B}from"./index-Ct8eLu1I.js";import{u as q}from"./useOrganizationSlug-Im1jCHRI.js";import{u as E,d as S,E as F,R as O}from"./useRaceFeedComments-DP5lK-7N.js";import{P as U,a as A}from"./PostComments-W5orljD5.js";import{A as H}from"./arrow-left-xu1INuH2.js";import{C as K}from"./copy-BLDCcnKG.js";import"./chevron-left-m_yK3qef.js";import"./sanitized-html-D_hDi9wu.js";import"./purify.es-C5KSVp3G.js";import"./thumbs-up-CrpZt3t6.js";import"./thumbs-down-ChN-DmeG.js";import"./textarea-ZX0L5GAv.js";import"./avatar-B8AgHX-V.js";import"./index-CJLyLLo7.js";import"./send-BmfKE8XA.js";import"./pen-cK6y1lt9.js";import"./trash-2-LxvlgA12.js";import"./eye-BX6Kc3UM.js";import"./eye-off-D8k5J7Ic.js";import"./formatDistanceToNow-nzxXZqmT.js";import"./en-US-CGO0aXMi.js";import"./differenceInCalendarMonths-D2gXU8RP.js";import"./endOfMonth--R-WtYph.js";import"./differenceInMilliseconds-CVPzdaho.js";function M(r,l){return R({queryKey:["public-race-feed-post",r,l],queryFn:async()=>{if(!r||!l)return null;const{data:s,error:o}=await B.from("race_feed_posts").select("id, organization_id, event_id, author_user_id, author_name, content, title, body_html, content_format, image_url, link_url, category, is_pinned, is_published, published_at, created_at, updated_at").eq("id",r).eq("organization_id",l).eq("is_published",!0).maybeSingle();if(o)throw o;return s??null},enabled:!!r&&!!l})}const de=()=>{const{orgSlug:r,postId:l}=j(),{data:s,isLoading:o}=q(r),{setOrganizationFromSlug:c,branding:a}=b(),{data:e,isLoading:u}=M(l,s==null?void 0:s.id),{data:p={}}=E(s==null?void 0:s.id),{data:x={}}=S(s==null?void 0:s.id),{data:h=[]}=g();d.useEffect(()=>{r&&c(r)},[r,c]),d.useEffect(()=>{e!=null&&e.title&&(document.title=e.title)},[e==null?void 0:e.title]);const f=h.some(n=>n.id===(s==null?void 0:s.id)&&(n.role==="admin"||n.role==="super_admin")),m=r?`/org/${r}/login`:"/auth",i=e?p[e.id]:void 0,_=(e==null?void 0:e.content_format)==="html"&&!!(e!=null&&e.body_html),y=()=>{navigator.clipboard.writeText(window.location.href),P.success("Link copied")};return t.jsx(N,{children:t.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-[680px]",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs(k,{to:r?`/org/${r}/feed`:"/",className:"inline-flex items-center gap-1 text-sm hover:underline",children:[t.jsx(H,{className:"h-4 w-4"})," Back to feed"]}),t.jsxs(v,{variant:"ghost",size:"sm",onClick:y,children:[t.jsx(K,{className:"h-3.5 w-3.5 mr-1"})," Copy link"]})]}),o||u?t.jsx("div",{className:"flex justify-center py-12",children:t.jsx(w,{className:"h-6 w-6 animate-spin",style:{color:(a==null?void 0:a.primary_color)||"hsl(var(--primary))"}})}):e?t.jsx(C,{children:t.jsxs(L,{className:"p-0",children:[t.jsxs("div",{className:"flex items-center gap-3 border-b p-4",children:[(a==null?void 0:a.logo_url)&&t.jsx("img",{src:a.logo_url,alt:"",className:"h-8 w-8 rounded object-contain"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-semibold truncate",children:(s==null?void 0:s.name)||e.author_name||"Race Update"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(e.published_at).toLocaleString()})]})]}),t.jsxs("div",{className:"p-4 md:p-6 space-y-4",children:[e.title&&t.jsx("h1",{className:"text-xl md:text-2xl font-bold",children:e.title}),_?t.jsx(F,{html:e.body_html}):t.jsx(O,{content:e.content,fallbackImageUrl:e.image_url}),e.link_url&&t.jsx("a",{href:e.link_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm underline break-all",style:a!=null&&a.primary_color?{color:a.primary_color}:{},children:e.link_url})]}),t.jsxs("div",{className:"flex items-center gap-1 border-t p-3 flex-wrap",children:[t.jsx(U,{postId:e.id,likeCount:(i==null?void 0:i.like_count)??0,dislikeCount:(i==null?void 0:i.dislike_count)??0,myReaction:x[e.id]??null,loginUrl:m}),t.jsx(A,{postId:e.id,commentCount:(i==null?void 0:i.comment_count)??0,loginUrl:m,canModerate:f})]})]})}):t.jsx("div",{className:"text-center py-16 opacity-70",children:t.jsx("p",{children:"This update is no longer available."})})]})})};export{de 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.