PageSourceSearch

https://squadbalance.com/build/assets/PollHistory-DQ8P4dMF.js

js squadbalance.com collected 2026-10-02 01:46:50 UTC 5,746 bytes, 1 lines download raw bytes

1import{r as s,j as e}from"./vendor-wHC2ntYA.js";import{A as M}from"./AuthenticatedLayout-Dt7btEMU.js";import{b as S,H as z,L as p,r as f}from"./inertia-BxUlTYdw.js";import A from"./PollHistoryCard-64o_s0OG.js";import P from"./DeletePollDialog-BVAOaArD.js";import T from"./DeleteAllPollsDialog-Cqv2aksq.js";import"./transition-Bqy6qNzb.js";import"./open-closed-B0EDQEYK.js";import"./formatScheduledAt-st07jk8t.js";import"./formatDateTime-COUDNvVQ.js";import"./clock-d7jOAyUV.js";import"./createLucideIcon-Dy18DS_c.js";import"./chevron-up-DLqAAOr_.js";import"./chevron-down-ZA5Ol8Gf.js";import"./trash-2-CBYew2br.js";import"./check-CK0YpgxQ.js";import"./x-pEWcRl6H.js";import"./alert-dialog-BqPmJ-Ez.js";import"./index-9z1s8jpi.js";import"./index-D1Fr3kbQ.js";import"./index-Cnj_YRLL.js";import"./index-CnCZDGbR.js";import"./index-DGQvBiqS.js";import"./index-BYz_zuFP.js";import"./app-CJjB2_mY.js";/* empty css            */import"./button-DgxPEQwo.js";import"./index-C3nnnCt4.js";function ae({squad:l,polls:n}){const{props:g}=S(),i=g.flash,[m,j]=s.useState(null),[r,a]=s.useState(null),[k,x]=s.useState(!1),[v,c]=s.useState(!1),[w,h]=s.useState(!1),[u,o]=s.useState(null),[b,d]=s.useState("success");s.useEffect(()=>{if(i?.success){o(i.success),d("success");const t=setTimeout(()=>o(null),5e3);return()=>clearTimeout(t)}},[i?.success]);const N=t=>{j(m===t?null:t)},D=t=>{a(t)},y=()=>{a(null)},C=()=>{r&&(x(!0),f.delete(route("squads.polls.destroy",[l.id,r.id]),{preserveScroll:!0,onSuccess:()=>{a(null)},onError:()=>{o("Failed to delete poll. Please try again."),d("error"),setTimeout(()=>o(null),5e3)},onFinish:()=>{x(!1)}}))},L=()=>{h(!0),f.delete(route("squads.polls.destroyAll",l.id),{preserveScroll:!0,onSuccess:()=>{c(!1)},onError:()=>{o("Failed to delete polls. Please try again."),d("error"),setTimeout(()=>o(null),5e3)},onFinish:()=>{h(!1)}})};return e.jsxs(M,{children:[e.jsx(z,{title:`Poll History - ${l.name}`}),e.jsx("div",{className:"py-12",children:e.jsxs("div",{className:"mx-auto max-w-2xl px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs(p,{href:route("squads.show",l.id),className:"inline-flex items-center gap-2 text-sm text-zinc-500 hover:text-zinc-700 mb-4 min-h-[44px]",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),"Back to ",l.name]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"font-display text-2xl text-zinc-900",children:"Poll History"}),n.length>0&&e.jsxs("button",{onClick:()=>c(!0),className:"inline-flex items-center gap-2 rounded-button border border-red-200 bg-white px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 transition-colors min-h-[44px]",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete All"]})]})]}),n.length===0?e.jsxs("div",{className:"rounded-card bg-white shadow-sm p-8 text-center",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-zinc-100 flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-zinc-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}),e.jsx("h2",{className:"font-display text-xl text-zinc-900 mb-2",children:"No polls yet"}),e.jsx("p",{className:"text-zinc-500 mb-4",children:"Create an attendance poll to start tracking who's coming to your next game."}),e.jsx(p,{href:route("squads.show",l.id),className:"inline-flex items-center justify-center rounded-button bg-blue-500 text-white px-6 py-3 min-h-[44px] font-medium hover:bg-blue-600 transition-colors",children:"Back to Squad"})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-zinc-500",children:[n.length," poll",n.length!==1?"s":""," total"]}),n.map(t=>e.jsx(A,{poll:t,isExpanded:m===t.id,onToggle:()=>N(t.id),onDelete:()=>D(t)},t.id))]})]})}),e.jsx(P,{poll:r,isOpen:!!r,isDeleting:k,onCancel:y,onConfirm:C}),e.jsx(T,{pollCount:n.length,isOpen:v,isDeleting:w,onCancel:()=>c(!1),onConfirm:L}),u&&e.jsx("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-50 animate-in slide-in-from-bottom-5 fade-in duration-300",children:e.jsxs("div",{className:"rounded-button bg-zinc-900 text-white px-4 py-3 shadow-lg flex items-center gap-3",children:[b==="success"?e.jsx("svg",{className:"w-5 h-5 text-green-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-5 h-5 text-red-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("span",{className:"text-sm",children:u}),e.jsx("button",{onClick:()=>o(null),className:"ml-2 text-zinc-400 hover:text-white transition-colors","aria-label":"Dismiss",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})]})}export{ae 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.