PageSourceSearch

https://seodoon-church-admin.web.app/assets/VisitationManagementPage-D6bcHfzV.js

js seodoon-church-admin.web.app collected 2026-10-03 12:37:04 UTC 3,436 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as o}from"./vendor-react-zNM0AU50.js";import{x as u}from"./index-D1K3lVhu.js";import{D as f}from"./DepartmentSelectorBar-EFx-1H4v.js";import{e as x}from"./educationService-BxXX95Q0.js";import{aa as b,H as y,A as j,c as N,n as w}from"./vendor-ui-CW5bJ11U.js";import"./vendor-firebase-Da9KY1q_.js";import"./vendor-charts-08G1rM8P.js";function U(){const{selectedDepartment:a,isAllSelected:r,departments:m}=u(),[i,l]=o.useState([]),[p,c]=o.useState(!0);o.useEffect(()=>{g()},[a]);const g=async()=>{c(!0);try{if(r){const s=[];await Promise.all(m.map(async t=>{try{const n=await x.getVisitations(t.firestorePrefix);s.push(...n.map(h=>({...h,_deptName:t.shortName})))}catch{}})),l(s.sort((t,n)=>n.date.localeCompare(t.date)))}else if(a)try{const s=await x.getVisitations(a.firestorePrefix);l(s)}catch{l([])}}catch(s){console.error("심방 기록 로딩 실패:",s)}finally{c(!1)}},d={정기심방:"bg-blue-100 text-blue-700",긴급심방:"bg-red-100 text-red-700",신규심방:"bg-green-100 text-green-700",기타:"bg-gray-100 text-gray-600"};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"심방 관리"}),e.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[r?"전체 부서":a==null?void 0:a.name," | ",i.length,"건"]})]}),!r&&e.jsxs("button",{className:"flex items-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors",children:[e.jsx(b,{className:"w-4 h-4"}),"심방 기록"]})]}),e.jsx(f,{}),p?e.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center text-gray-400",children:e.jsx("div",{className:"inline-block w-8 h-8 border-2 border-gray-200 border-t-blue-500 rounded-full animate-spin"})}):i.length===0?e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center text-gray-400",children:[e.jsx(y,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"심방 기록이 없습니다"})]}):e.jsx("div",{className:"space-y-3",children:i.map(s=>{const t=s._deptName;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 hover:border-gray-300 transition-colors",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-bold text-gray-900",children:s.studentName}),t&&e.jsx("span",{className:"px-2 py-0.5 bg-gray-100 rounded text-xs text-gray-500",children:t}),e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${d[s.type]||d.기타}`,children:s.type})]}),s.followUpRequired&&!s.followUpDone&&e.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 bg-orange-100 text-orange-700 rounded-full text-xs font-medium",children:[e.jsx(j,{className:"w-3 h-3"}),"후속조치 필요"]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 mb-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(N,{className:"w-3 h-3"}),s.date]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(w,{className:"w-3 h-3"}),s.visitor]})]}),e.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:s.content})]},s.id)})})]})}export{U as VisitationManagementPage};

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.