PageSourceSearch

https://www.codechef.com/build/react2/assets/BlogsLayout-vNOB4vk8.js

js codechef.com collected 2026-09-24 08:54:57 UTC 3,469 bytes, 1 lines download raw bytes

1import{r as s,Z as t,a2 as B,Y as x}from"./vendor-mui-D5pLRgDb.js";import{L as p,F as d,O as L,cJ as D,k as R,U as w,r as S,q as A,z as U,C as g,A as _,d as E,e as M,T as F}from"./index-BSFWpFMK.js";import{T as H}from"./TwoColumnLayout-CEOrMY6p.js";import{M as P}from"./ManageTabs-CrKh4Y_n.js";import{F as k,S as I,a as m,b as N}from"./Actions-CzYwivyg.js";import{B as z,C as O,f as $}from"./Constants-BUZe5jGN.js";import{D as q}from"./DataTable-cROclEAW.js";import{U as G}from"./UploadImage-_11Ivv9M.js";import"./__commonjsHelpers__-BosuxZz1.js";import"./vendor-sweetalert2-CokzRhbv.js";import"./TopBanner-C3LORJp2.js";import"./vendor-react-csv-Uy1MYOCL.js";import"./BreadCrumbs-Ce1rw5PH.js";import"./TopBanner.module--qQpYJq9.js";import"./TwoColumnBox-gHXb3Blm.js";import"./InputFields-BJUL-RVv.js";import"./CheckBox-Dkb41L1G.js";import"./MarkdownEditor-BtSRCuv5.js";import"./index-c9rYO0F_.js";import"./vendor-ace-CwHVNqeR.js";import"./vendor-mui-datatables-CtAfvKRw.js";import"./MarkdownPreviewLite-BMFeJbgK.js";import"./index-CzV2ELU3.js";import"./vendor-react-markdown-P-Rpclqe.js";import"./vendor-katex--NZxydnM.js";import"./vendor-prismjs-YHDdZf5t.js";/* empty css              *//* empty css                      */import"./ProblemSolution.module-B8G4Vgx3.js";import"./server.browser-BvHsT_cG.js";import"./index.es-CLmToPHp.js";import"./Select-BphtUsk_.js";function W(){const{state:a}=s.useContext(u);return t(q,{title:"All Blogs",columns:[{label:"Title",name:"title"},{label:"Slug",name:"slug"},{label:"Created By",name:"username"},{label:"Public",name:"is_public",options:{customBodyRender:o=>t(B,{children:o?"Yes":"No"}),sort:!1,customHeadLabelRender:o=>t("div",{style:{color:"white"},children:o.label})}},{label:"Manage",name:"slug",options:{customBodyRender:o=>t(p,{to:`/manage/blogs/${o}`,style:{padding:"5px"},children:t(d,{icon:L})}),sort:!1,customHeadLabelRender:o=>t("div",{style:{color:"white"},children:o.label})}},{label:"View",name:"slug",options:{customBodyRender:o=>t(p,{target:"_blank",to:`/blogs/${o}`,style:{padding:"5px"},children:t(d,{icon:D})}),sort:!1,customHeadLabelRender:o=>t("div",{style:{color:"white"},children:o.label})}}],data:a.blogs,noRecordsMessage:"No blogs available"})}const Y=a=>{switch(a){case"dashboard":return t(W,{});case"create_blog":return t(O,{});case"upload_image":return t(G,{imageUploadUrl:z});default:return t(R,{})}};function j(){const a=s.useContext(u),{activeTab:e}=a.state;return Y(e)}const b={activeTab:"dashboard",blogs:[]},J=(a,e)=>{switch(e.type){case I:return{...a,activeTab:e.payload};case k:return{...a,blogs:e.payload};default:return a}},u=x.createContext({state:b,dispatch:{}});function wt(){const[a,e]=s.useReducer(J,b),{state:o,dispatch:i}=s.useContext(w),[r,f]=s.useState([]),h=S(),T=A(),n=U.parse(T.search);s.useEffect(()=>{(async()=>{try{const c=await _.get("/api/manage/blogs"),{blogs:y}=c.data;e(N(y));const v=$();f(v),i(E("Manage Blogs"))}catch(c){i(M(c))}finally{i(F(!1))}})()},[]),s.useEffect(()=>{r.length&&e(m(g(r,n)))},[n.tab,r]);const C=()=>[{link:"/",name:"Home"},{link:null,name:"Blogs"}];return s.useEffect(()=>{r.length&&e(m(g(r,n)))},[n.tab,r]),t(u.Provider,{value:{state:a,dispatch:e},children:t(H,{title:"Blogs",navItems:[],breadCrumbData:C(),rightColumnData:t(j,{}),leftMaxWidth:"240px",leftColumnData:t(P,{fields:r,handleTabChange:l=>{h({pathname:"/manage/blogs",search:`?tab=${l}`}),e(m(l))},activeTab:a.activeTab,name:"Blogs"})})})}export{u as BlogsContext,wt 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.