PageSourceSearch

https://www.nicecleanproject.com/assets/AdminSurveyPage-D14BW8dT.js

js nicecleanproject.com collected 2026-10-04 19:22:12 UTC 4,162 bytes, 1 lines download raw bytes

1import{b as N,r,V as v,aa as y,l as S,q as I,m as A,e as w,E,j as e,R,L as C,ab as m,A as L,ac as T,ad as k,ae as _,G as $}from"./index-MZT8fRkg.js";import{A as P}from"./AdminLayout-A-gOMNRA.js";import{R as B}from"./RegionTabs-lpyrpdn7.js";import{C as O}from"./chevron-up-CdAxfr2X.js";function z(a){if(!a)return"—";const t=a.toDate();return`${t.getFullYear()}/${String(t.getMonth()+1).padStart(2,"0")}/${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function u(a,t,c){return a.map(d=>d==="other"&&c?`${t[d]}: ${c}`:t[d]).join(" / ")}function q(){const{regions:a}=N(),[t,c]=r.useState([]),[i,d]=r.useState("all"),[h,p]=r.useState(!0),[b,j]=r.useState(null),o=r.useMemo(()=>i==="all"?t:v(t,i),[t,i]),g=r.useCallback(s=>{const n=y(s);return a.find(f=>f.regionId===n)?.name??n},[a]),x=r.useCallback(async()=>{p(!0);try{const s=await S(I(A(w,"surveyResponses"),E("submittedAt","desc")));c(s.docs.map(n=>({responseId:n.id,...n.data()})))}finally{p(!1)}},[]);return r.useEffect(()=>{x()},[x]),e.jsxs(P,{title:"アンケート回答",children:[e.jsx("div",{className:"mb-4",children:e.jsx(B,{value:i,onChange:d,includeAll:!0})}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("p",{className:"text-ncp-text-muted text-sm",children:[o.length," 件"]}),e.jsxs("button",{onClick:x,className:"flex items-center gap-1.5 px-3 py-2 text-sm text-ncp-text-muted hover:text-ncp-navy border border-ncp-border rounded-xl hover:bg-white transition-colors",children:[e.jsx(R,{size:14}),"更新"]})]}),h?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(C,{size:32,className:"animate-spin text-ncp-pink"})}):o.length===0?e.jsx("div",{className:"text-center py-16 text-ncp-text-muted",children:"アンケート回答はまだありません"}):e.jsx("div",{className:"space-y-3",children:o.map(s=>{const n=b===s.responseId;return e.jsxs("div",{className:"bg-white rounded-2xl border border-ncp-border shadow-sm overflow-hidden",children:[e.jsx("div",{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full bg-ncp-navy/10 text-ncp-navy",children:g(s)}),e.jsxs("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full bg-ncp-pink/10 text-ncp-pink",children:["満足度 ",s.satisfaction,"/5"]}),e.jsx("span",{className:"text-xs text-ncp-text-muted",children:z(s.submittedAt)})]}),e.jsx("p",{className:"font-bold text-ncp-navy truncate",children:s.brochureLocation}),e.jsx("p",{className:"text-xs text-ncp-text-muted truncate",children:m[s.participantType]})]}),e.jsx("button",{onClick:()=>j(n?null:s.responseId),className:"p-1 text-ncp-text-muted hover:text-ncp-navy transition-colors shrink-0",children:n?e.jsx(O,{size:18}):e.jsx(L,{size:18})})]})}),n&&e.jsxs("div",{className:"border-t border-ncp-border bg-ncp-gray-light/30 p-4 grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[e.jsx(l,{label:"知ったきっかけ",children:u(s.awarenessSources,T,s.awarenessOther)}),e.jsx(l,{label:"参加回数",children:k[s.participationCount]}),e.jsx(l,{label:"属性",children:m[s.participantType]}),e.jsx(l,{label:"パンフレット入手場所",children:s.brochureLocation}),e.jsx(l,{label:"参加してみた感想",wide:!0,children:u(s.impressions,_,s.impressionOther)}),s.email&&e.jsx(l,{label:"メールアドレス",children:e.jsxs("a",{href:`mailto:${s.email}`,className:"inline-flex items-center gap-1 text-ncp-pink hover:underline break-all",children:[e.jsx($,{size:12}),s.email]})}),s.message&&e.jsx(l,{label:"ひとこと",wide:!0,children:e.jsx("span",{className:"whitespace-pre-wrap",children:s.message})})]})]},s.responseId)})})]})}function l({label:a,children:t,wide:c}){return e.jsxs("div",{className:c?"md:col-span-2":"",children:[e.jsx("p",{className:"text-xs text-ncp-text-muted mb-1",children:a}),e.jsx("p",{className:"font-medium text-ncp-text leading-relaxed",children:t})]})}
1export{q 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.