PageSourceSearch

https://www.techshotsapp.com/_next/static/chunks/pages/cms/push-notifications-e8f443a0eefd14e8.js

js techshotsapp.com collected 2026-10-04 13:25:21 UTC 3,648 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9397],{68906:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cms/push-notifications",function(){return n(93659)}])},93659:function(e,s,n){"use strict";n.r(s);var t=n(85893),i=n(67294),r=n(9008),o=n.n(r),a=n(64895),c=n.n(a);let isPushSuccessResponse=e=>"object"==typeof e&&null!==e&&"string"==typeof e.message&&"number"==typeof e.sent&&"number"==typeof e.failed,isPushErrorResponse=e=>"object"==typeof e&&null!==e&&"string"==typeof e.error;s.default=()=>{let[e,s]=(0,i.useState)(""),[n,r]=(0,i.useState)(""),[a,l]=(0,i.useState)(!1),[d,u]=(0,i.useState)(""),handleSubmit=async t=>{if(t.preventDefault(),!e||!n){u("Please fill in both title and body");return}l(!0),u("");try{let t=await fetch("/api/push-notifications/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,body:n,icon:"/static/logo.svg",badge:"/static/logo.svg"})}),i=await t.json();if(t.ok){if(isPushSuccessResponse(i)){let{message:e,sent:n,failed:t}=i;u("✅ ".concat(e," - Sent: ").concat(n,", Failed: ").concat(t)),s(""),r("")}else u("❌ Unexpected success response shape from server."),console.error("Unexpected success response:",i)}else isPushErrorResponse(i)?u("❌ Error: ".concat(i.error)):(u("❌ Unexpected error response from server."),console.error("Unexpected error response:",i))}catch(e){e instanceof Error?(u("❌ Failed to send notifications: ".concat(e.message)),console.error("Error sending notifications:",e)):(u("❌ Failed to send notifications: unknown error"),console.error("Unknown error sending notifications:",e))}finally{l(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o(),{children:(0,t.jsx)("title",{children:"Push Notifications | Techshots CMS"})}),(0,t.jsx)("div",{className:c().container,children:(0,t.jsxs)("div",{className:c().content,children:[(0,t.jsx)("h1",{className:c().title,children:"Send Push Notifications"}),d&&(0,t.jsx)("div",{className:"alert ".concat(d.includes("✅")?"alert-success":"alert-danger"),children:d}),(0,t.jsxs)("form",{onSubmit:e=>{handleSubmit(e)},className:c().form,children:[(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("label",{htmlFor:"title",className:"form-label",children:"Notification Title *"}),(0,t.jsx)("input",{type:"text",id:"title",className:"form-control",value:e,onChange:e=>s(e.target.value),placeholder:"Enter notification title",required:!0,maxLength:100})]}),(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("label",{htmlFor:"body",className:"form-label",children:"Notification Message *"}),(0,t.jsx)("textarea",{id:"body",className:"form-control",value:n,onChange:e=>r(e.target.value),placeholder:"Enter notification message",required:!0,rows:4,maxLength:500})]}),(0,t.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Sending...":"Send Push Notification"})]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("h3",{children:"Instructions:"}),(0,t.jsxs)("ul",{children:[(0,t.jsx)("li",{children:"Title should be short and catchy (max 100 characters)"}),(0,t.jsx)("li",{children:"Message should be informative but concise (max 500 characters)"}),(0,t.jsx)("li",{children:"Notifications will be sent to all subscribed users"}),(0,t.jsx)("li",{children:"Users can unsubscribe at any time from the website"})]})]})]})})]})}},64895:function(e){e.exports={mainContent:"cms_mainContent__6ZgG5",table:"cms_table__WD0am","btn-outline-dark":"cms_btn-outline-dark__GM6v1",ldsDualRing:"cms_ldsDualRing__odO6U","lds-dual-ring":"cms_lds-dual-ring__O_Z8U"}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=68906)}),_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.