PageSourceSearch

https://vid.ai/_next/static/chunks/pages/admin/dashboard/credit-logs-d31ee45fc562c41e.js

js vid.ai collected 2026-10-04 06:54:41 UTC 14,889 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2706],{46569:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/dashboard/credit-logs",function(){return r(45813)}])},61258:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(63759).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},28979:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(63759).Z)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},74882:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(63759).Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},8007:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(63759).Z)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},56286:function(e,t,r){"use strict";r.d(t,{I:function(){return i}});var s=r(85893),a=r(67294),n=r(30981);let i=a.forwardRef((e,t)=>{let{className:r,type:a,...i}=e;return(0,s.jsx)("input",{type:a,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...i})});i.displayName="Input"},98310:function(e,t,r){"use strict";r.d(t,{_:function(){return o}});var s=r(85893),a=r(67294),n=r(99489),i=r(12003),d=r(30981);let l=(0,i.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.f,{ref:t,className:(0,d.cn)(l(),r),...a})});o.displayName=n.f.displayName},35134:function(e,t,r){"use strict";r.d(t,{O:function(){return n}});var s=r(85893),a=r(30981);function n(e){let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-md bg-muted",t),...r})}},59892:function(e,t,r){"use strict";r.d(t,{r:function(){return d}});var s=r(85893),a=r(67294),n=r(60761),i=r(30981);let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.fC,{className:(0,i.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-zinc-900 data-[state=unchecked]:bg-zinc-200 dark:focus-visible:ring-zinc-300 dark:focus-visible:ring-offset-zinc-950 dark:data-[state=checked]:bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-800",r),...a,ref:t,children:(0,s.jsx)(n.bU,{className:(0,i.cn)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-zinc-950")})})});d.displayName=n.fC.displayName},80708:function(e,t,r){"use strict";r.d(t,{RM:function(){return l},Rn:function(){return h},SC:function(){return c},iA:function(){return i},pj:function(){return f},ss:function(){return u},xD:function(){return d},yt:function(){return o}});var s=r(85893),a=r(67294),n=r(30981);let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("div",{className:"w-full overflow-auto",children:(0,s.jsx)("table",{ref:t,className:(0,n.cn)("w-full caption-bottom text-sm",r),...a})})});i.displayName="Table";let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("thead",{ref:t,className:(0,n.cn)("[&_tr]:border-b",r),...a})});d.displayName="TableHeader";let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("tbody",{ref:t,className:(0,n.cn)("[&_tr:last-child]:border-0",r),...a})});l.displayName="TableBody";let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("tfoot",{ref:t,className:(0,n.cn)("bg-primary font-medium text-primary-foreground",r),...a})});o.displayName="TableFooter";let c=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("tr",{ref:t,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a})});c.displayName="TableRow";let u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("th",{ref:t,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a})});u.displayName="TableHead";let f=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("td",{ref:t,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a})});f.displayName="TableCell";let h=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)("caption",{ref:t,className:(0,n.cn)("mt-4 text-sm text-muted-foreground",r),...a})});h.displayName="TableCaption"},22543:function(e,t,r){"use strict";r.d(t,{_v:function(){return c},aJ:function(){return o},pn:function(){return d},u:function(){return l}});var s=r(85893),a=r(67294),n=r(12993),i=r(30981);let d=n.zt,l=n.fC,o=n.xz,c=a.forwardRef((e,t)=>{let{className:r,sideOffset:a=4,...d}=e;return(0,s.jsx)(n.VY,{ref:t,sideOffset:a,className:(0,i.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...d})});c.displayName=n.VY.displayName},45813:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return w}});var s=r(85893),a=r(67294),n=r(47560),i=r(66845),d=r(87066),l=r(86501),o=r(35134),c=r(56286),u=r(21488),f=r(59429),h=r(80708),x=r(62190),m=r(74598),p=r(61258),j=r(4307),b=r(59892),g=r(98310),v=r(22543),w=!0;t.default=e=>{let{user:t}=e,[r,w]=(0,a.useState)(""),[y,k]=(0,a.useState)(!1),[N,C]=(0,a.useState)([]),[S,P]=(0,a.useState)(0),[R,z]=(0,a.useState)(1),[Z,_]=(0,a.useState)(0),[E,I]=(0,a.useState)(10),[T,A]=(0,a.useState)("asc"),[L,D]=(0,a.useState)(!0),[M,O]=(0,a.useState)(!1),V=async()=>{if(!r){l.ZP.error("Please enter an email address");return}k(!0);try{let e=await d.Z.get("/api/admin/getCreditLogsAPI",{params:{email:r,page:R||1,limit:E,sortBy:T,showAll:L}});"success"===e.data.message?(0===e.data.result.creditLogs.length?l.ZP.error("No logs found for the given email"):(C(e.data.result.creditLogs),P(e.data.result.pagination.totalPages),z(e.data.result.pagination.page),_(e.data.result.pagination.total)),O(L)):l.ZP.error("Failed to retrieve credit logs")}catch(e){console.error(e),l.ZP.error("An error occurred while retrieving the credit logs")}finally{k(!1)}};return(0,a.useEffect)(()=>{""!==r&&V()},[R]),(0,s.jsxs)(i.Z,{children:[(0,s.jsx)(f.Z,{breadcrumbItems:[{text:"Dashboard",href:"/admin"},{text:"Admin Panel",href:"/admin"},{text:"Credit Log",href:"/admin/credit-log"}]}),(0,s.jsx)(n.Z,{title:"Credit Logs | Admin | VidAI"}),(0,s.jsxs)("div",{className:"max-w-5xl 2xl:max-w-6xl mx-auto justify-center mt-8 p-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h1",{className:"text-3xl font-semibold dark:text-white text-black",children:"Check Credit Log"})}),(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-row gap-x-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(c.I,{label:"Email",placeholder:"Enter email address",type:"email",value:r,onChange:e=>w(e.target.value),onKeyPress:e=>{"Enter"===e.key&&V()},className:"dark:text-white text-black w-[400px]",disabled:y})}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(b.r,{id:"show-all-switch",checked:L,onCheckedChange:D,disabled:y}),(0,s.jsx)(g._,{htmlFor:"show-all-switch",className:"",children:"Show all"})]}),(0,s.jsx)("div",{children:(0,s.jsx)(c.I,{label:"Limit",placeholder:"Enter number of logs per page",type:"number",min:"1",value:E,onChange:e=>I(parseInt(e.target.value)||10),onKeyPress:e=>{"Enter"===e.key&&V()},className:"dark:text-white text-black w-[100px]",disabled:y||L})}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(b.r,{id:"sort-switch",checked:"asc"===T,onCheckedChange:()=>A("asc"===T?"desc":"asc"),disabled:y}),(0,s.jsx)(g._,{htmlFor:"sort-switch",className:"w-[80px]",children:"asc"===T?"Ascending":"Descending"})]}),(0,s.jsx)("div",{children:(0,s.jsx)(u.z,{onClick:()=>{w(""),C([]),P(0),z(1),_(0),I(10),setSort("asc"),D(!0),O(!1)},disabled:y,variant:"outline",children:(0,s.jsx)(x.Z,{size:20})})}),(0,s.jsx)("div",{children:(0,s.jsx)(u.z,{onClick:V,disabled:y||""===r,children:"Search"})})]}),N&&N.length>0&&(0,s.jsx)("div",{children:(0,s.jsxs)("p",{className:"text-sm text-gray-400",children:["Total Rows: ",Z]})})]}),N&&N.length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("div",{children:(0,s.jsxs)(h.iA,{children:[(0,s.jsx)(h.xD,{children:(0,s.jsxs)(h.SC,{children:[(0,s.jsx)(h.ss,{children:"Source"}),(0,s.jsx)(h.ss,{children:"Action"}),(0,s.jsx)(h.ss,{children:"Info"}),(0,s.jsx)(h.ss,{children:"Credits"}),M&&(0,s.jsx)(h.ss,{children:"Last Credit"}),(0,s.jsx)(h.ss,{children:"Project Name"}),(0,s.jsx)(h.ss,{children:"Project ID"}),(0,s.jsx)(h.ss,{children:"Project Status"}),(0,s.jsx)(h.ss,{children:"Created At"})]})}),(0,s.jsxs)(h.RM,{children:[!y&&N.map(e=>(0,s.jsxs)(h.SC,{children:[(0,s.jsx)(h.pj,{children:e.source}),(0,s.jsx)(h.pj,{children:e.action}),(0,s.jsx)(h.pj,{children:e.info}),(0,s.jsx)(h.pj,{children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[e.credit,e.comment&&(0,s.jsx)(v.pn,{children:(0,s.jsxs)(v.u,{children:[(0,s.jsx)(v.aJ,{asChild:!0,children:(0,s.jsx)(m.Z,{className:"h-3.5 w-3.5 text-zinc-400 cursor-pointer"})}),(0,s.jsx)(v._v,{children:(0,s.jsx)("p",{children:e.comment})})]})})]})}),(null==e?void 0:e.previousCredit)!==void 0&&M&&(0,s.jsx)(h.pj,{children:e.previousCredit}),(0,s.jsx)(h.pj,{children:e.projectName||"-"}),(0,s.jsx)(h.pj,{children:e.projectId}),(0,s.jsx)(h.pj,{children:e.projectStatus||"-"}
1),(0,s.jsx)(h.pj,{children:new Date(e.createdAt).toLocaleString()})]},e.id)),y&&[...Array(10)].map((e,t)=>(0,s.jsx)(h.SC,{children:[...Array(M?8:7)].map((e,t)=>(0,s.jsx)(h.pj,{children:(0,s.jsx)(o.O,{className:"h-4 w-full"})},t))},t))]})]})}),(0,s.jsxs)("div",{className:"flex items-center justify-center mt-4 gap-x-2 text-sm",children:[(0,s.jsx)("div",{children:(0,s.jsx)(u.z,{onClick:()=>{z(e=>e-1)},disabled:R<=1||y,variant:"ghost",children:(0,s.jsx)(p.Z,{})})}),(0,s.jsx)("div",{children:(0,s.jsxs)("span",{children:["Page ",R," of ",S]})}),(0,s.jsx)("div",{children:(0,s.jsx)(u.z,{onClick:()=>{z(e=>e+1)},disabled:R>=S||y,variant:"ghost",children:(0,s.jsx)(j.Z,{})})})]})]})]})]})]})}},99489:function(e,t,r){"use strict";r.d(t,{f:function(){return l}});var s=r(67294);r(73935);var a=r(88426),n=r(85893),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,a.Z8)(`Primitive.${t}`),i=s.forwardRef((e,s)=>{let{asChild:a,...i}=e,d=a?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(d,{...i,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),d=s.forwardRef((e,t)=>(0,n.jsx)(i.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));d.displayName="Label";var l=d},12072:function(e,t,r){"use strict";r.d(t,{f:function(){return c}});var s=r(67294);r(73935);var a=r(88426),n=r(85893),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,a.Z8)(`Primitive.${t}`),i=s.forwardRef((e,s)=>{let{asChild:a,...i}=e,d=a?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(d,{...i,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),d="horizontal",l=["horizontal","vertical"],o=s.forwardRef((e,t)=>{let{decorative:r,orientation:s=d,...a}=e,o=l.includes(s)?s:d;return(0,n.jsx)(i.div,{"data-orientation":o,...r?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},...a,ref:t})});o.displayName="Separator";var c=o},60761:function(e,t,r){"use strict";r.d(t,{bU:function(){return k},fC:function(){return y}});var s=r(67294),a=r(36206),n=r(28771),i=r(25360),d=r(77342),l=r(57898),o=r(7546),c=r(64757),u=r(85893),f="Switch",[h,x]=(0,i.b)(f),[m,p]=h(f),j=s.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:l,defaultChecked:o,required:h,disabled:x,value:p="on",onCheckedChange:j,form:b,...g}=e,[y,k]=s.useState(null),N=(0,n.e)(t,e=>k(e)),C=s.useRef(!1),S=!y||b||!!y.closest("form"),[P,R]=(0,d.T)({prop:l,defaultProp:o??!1,onChange:j,caller:f});return(0,u.jsxs)(m,{scope:r,checked:P,disabled:x,children:[(0,u.jsx)(c.WV.button,{type:"button",role:"switch","aria-checked":P,"aria-required":h,"data-state":w(P),"data-disabled":x?"":void 0,disabled:x,value:p,...g,ref:N,onClick:(0,a.Mj)(e.onClick,e=>{R(e=>!e),S&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),S&&(0,u.jsx)(v,{control:y,bubbles:!C.current,name:i,value:p,checked:P,required:h,disabled:x,form:b,style:{transform:"translateX(-100%)"}})]})});j.displayName=f;var b="SwitchThumb",g=s.forwardRef((e,t)=>{let{__scopeSwitch:r,...s}=e,a=p(b,r);return(0,u.jsx)(c.WV.span,{"data-state":w(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})});g.displayName=b;var v=s.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:a=!0,...i},d)=>{let c=s.useRef(null),f=(0,n.e)(c,d),h=(0,l.D)(r),x=(0,o.t)(t);return s.useEffect(()=>{let e=c.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==r&&t){let s=new Event("click",{bubbles:a});t.call(e,r),e.dispatchEvent(s)}},[h,r,a]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:f,style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function w(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput";var y=j,k=g}},function(e){e.O(0,[5089,9702,1691,4597,7066,5070,5263,3615,8714,2888,9774,179],function(){return e(e.s=46569)}
1),_N_E=e.O()}]);

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.