PageSourceSearch

https://seodoon-church-admin.web.app/assets/ChurchSettingsPage-D4ToOCQl.js

js seodoon-church-admin.web.app collected 2026-10-03 12:36:33 UTC 26,115 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-data-Z5doMMu-.js";import{r as f}from"./vendor-react-zNM0AU50.js";import{s as _}from"./settingsService-BWi-XAI3.js";import{s as S}from"./storageService-HxVmCucr.js";import{a7 as x,_ as U,bk as G,ai as F,a8 as C,bl as M,ae as D,n as R,ak as A,an as T,i as L,aa as w,T as k,ad as P,f as E}from"./vendor-ui-CW5bJ11U.js";import"./vendor-firebase-Da9KY1q_.js";import"./index-D1K3lVhu.js";import"./vendor-charts-08G1rM8P.js";const B={name:"",position:"담임목사",photoUrl:"",greeting:""},Y={mission:"",visionText:"",yearMottoYear:new Date().getFullYear().toString(),yearMotto:"",declaration:"",communities:[]},z=[{category:"주일예배",services:[{name:"",time:"",location:""}]},{category:"주중예배",services:[{name:"",time:"",location:""}]},{category:"교회학교",services:[{name:"",time:"",location:""}]}];function ee(){const[t,c]=f.useState(!0),[h,p]=f.useState(!1),[v,u]=f.useState("church"),[r,g]=f.useState({church_name:"",church_name_en:"",phone:"",fax:"",email:"",website:"",address:"",address_detail:"",postal_code:"",logo_url:"",banner_image_url:"",youtube_url:"",facebook_url:"",instagram_url:"",motto_year:new Date().getFullYear().toString(),motto_text:"",worship_schedule:[],updated_by:"admin"}),[n,a]=f.useState({pastorGreeting:{...B},vision:{...Y},history:[],worshipSchedule:z.map(m=>({...m,services:m.services.map(j=>({...j}))})),updated_at:"",updated_by:"admin"});f.useEffect(()=>{o()},[]);async function o(){try{c(!0);const[m,j]=await Promise.all([_.getChurchSettings(),_.getChurchIntro()]);m&&g(m),j&&a(j)}catch(m){console.error("설정 로딩 실패:",m),x.error("설정을 불러올 수 없습니다")}finally{c(!1)}}async function l(){try{p(!0),await _.saveChurchSettings(r),x.success("교회 정보가 저장되었습니다")}catch{x.error("저장에 실패했습니다")}finally{p(!1)}}async function s(){try{p(!0),await _.saveChurchIntro(n),x.success("교회소개가 저장되었습니다")}catch{x.error("저장에 실패했습니다")}finally{p(!1)}}async function i(m){var y;const j=(y=m.target.files)==null?void 0:y[0];if(j)try{x.loading("로고를 업로드하는 중...");const N=await S.uploadBannerImage(j);g({...r,logo_url:N}),x.dismiss(),x.success("로고가 업로드되었습니다")}catch{x.dismiss(),x.error("업로드에 실패했습니다")}}async function d(m){var y;const j=(y=m.target.files)==null?void 0:y[0];if(j)try{x.loading("배너를 업로드하는 중...");const N=await S.uploadBannerImage(j);g({...r,banner_image_url:N}),x.dismiss(),x.success("배너가 업로드되었습니다")}catch{x.dismiss(),x.error("업로드에 실패했습니다")}}async function b(m){var y;const j=(y=m.target.files)==null?void 0:y[0];if(j)try{x.loading("사진을 업로드하는 중...");const N=await S.uploadBannerImage(j);a({...n,pastorGreeting:{...n.pastorGreeting,photoUrl:N}}),x.dismiss(),x.success("사진이 업로드되었습니다")}catch{x.dismiss(),x.error("업로드에 실패했습니다")}}return t?e.jsx("div",{className:"flex items-center justify-center h-96",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"설정을 불러오는 중..."})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[18px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(U,{className:"w-5 h-5 text-blue-600"}),"교회설정"]}),e.jsx("p",{className:"text-[12px] text-gray-500 mt-1",children:"교회 정보 및 교회소개 콘텐츠를 관리합니다"})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm",children:[e.jsxs("div",{className:"flex border-b border-gray-200",children:[e.jsxs("button",{onClick:()=>u("church"),className:`flex-1 px-4 py-3 text-[13px] font-medium transition-colors ${v==="church"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-900"}`,children:[e.jsx(G,{className:"w-4 h-4 inline mr-2"}),"교회 정보"]}),e.jsxs("button",{onClick:()=>u("intro"),className:`flex-1 px-4 py-3 text-[13px] font-medium transition-colors ${v==="intro"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-900"}`,children:[e.jsx(U,{className:"w-4 h-4 inline mr-2"}),"교회소개"]})]}),e.jsx("div",{className:"p-6",children:v==="church"?e.jsx(H,{settings:r,onChange:g,onLogoUpload:i,onBannerUpload:d,onSave:l,saving:h}):e.jsx(O,{intro:n,onChange:a,onPastorPhotoUpload:b,onSave:s,saving:h})})]})]})}
1function H({settings:t,onChange:c,onLogoUpload:h,onBannerUpload:p,onSave:v,saving:u}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-[14px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4"})," 기본 정보"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["교회명 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.church_name,onChange:r=>c({...t,church_name:r.target.value}),className:"compact-input",placeholder:"서둔교회"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"교회명 (영문)"}),e.jsx("input",{type:"text",value:t.church_name_en,onChange:r=>c({...t,church_name_en:r.target.value}),className:"compact-input",placeholder:"Seodoon Church"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["전화번호 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"tel",value:t.phone,onChange:r=>c({...t,phone:r.target.value}),className:"compact-input",placeholder:"031-123-4567"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"팩스"}),e.jsx("input",{type:"tel",value:t.fax,onChange:r=>c({...t,fax:r.target.value}),className:"compact-input",placeholder:"031-123-4568"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["이메일 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",value:t.email,onChange:r=>c({...t,email:r.target.value}),className:"compact-input",placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"홈페이지"}),e.jsx("input",{type:"url",value:t.website,onChange:r=>c({...t,website:r.target.value}),className:"compact-input",placeholder:"https://church.com"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-[14px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(F,{className:"w-4 h-4"})," 주소"]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["기본 주소 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.address,onChange:r=>c({...t,address:r.target.value}),className:"compact-input",placeholder:"경기도 화성시 ..."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"상세 주소"}),e.jsx("input",{type:"text",value:t.address_detail,onChange:r=>c({...t,address_detail:r.target.value}),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"우편번호"}),e.jsx("input",{type:"text",value:t.postal_code,onChange:r=>c({...t,postal_code:r.target.value}),className:"compact-input",placeholder:"12345"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-[14px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(C,{className:"w-4 h-4"})," 이미지"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"교회 로고"}),t.logo_url&&e.jsx("img",{src:t.logo_url,alt:"로고",className:"w-32 h-32 object-contain bg-gray-50 rounded mb-2"}),e.jsxs("label",{className:"flex items-center justify-center gap-2 px-4 py-2 border-2 border-dashed border-gray-300 rounded hover:border-blue-600 cursor-pointer transition-colors",children:[e.jsx(C,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-[13px] text-gray-600",children:"로고 업로드"}),e.jsx("input",{type:"file",accept:"image/*",onChange:h,className:"hidden"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"메인 배너"}),t.banner_image_url&&e.jsx("img",{src:t.banner_image_url,alt:"배너",className:"w-full h-32 object-cover bg-gray-50 rounded mb-2"}),e.jsxs("label",{className:"flex items-center justify-center gap-2 px-4 py-2 border-2 border-dashed border-gray-300 rounded hover:border-blue-600 cursor-pointer transition-colors",children:[e.jsx(C,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-[13px] text-gray-600",children:"배너 업로드"}),e.jsx("input",{type:"file",accept:"image/*",onChange:p,className:"hidden"})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-[14px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"})," 소셜 미디어"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"유튜브 URL"}),e.jsx("input",{type:"url",value:t.youtube_url,onChange:r=>c({...t,youtube_url:r.target.value}),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"페이스북 URL"}),e.jsx("input",{type:"url",value:t.facebook_url,onChange:r=>c({...t,facebook_url:r.target.value}),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"인스타그램 URL"}),e.jsx("input",{type:"url",value:t.instagram_url,onChange:r=>c({...t,instagram_url:r.target.value}),className:"compact-input"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"표어"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"연도"}),e.jsx("input",{type:"text",value:t.motto_year,onChange:r=>c({...t,motto_year:r.target.value}),className:"compact-input",placeholder:"2026"})]}),e.jsxs("div",{className:"col-span-3",children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"표어 문구"}),e.jsx("input",{type:"text",value:t.motto_text,onChange:r=>c({...t,motto_text:r.target.value}),className:"compact-input"})]})]})]}),e.jsx("div",{className:"pt-4 border-t border-gray-200",children:e.jsxs("button",{onClick:v,disabled:u,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:[e.jsx(D,{className:"w-4 h-4"}),u?"저장 중...":"교회 정보 저장"]})})]})}function O({intro:t,onChange:c,onPastorPhotoUpload:h,onSave:p,saving:v}){const[u,r]=f.useState("pastor"),g=(a,o)=>{c({...t,pastorGreeting:{...t.pastorGreeting,[a]:o}})},n=(a,o)=>{c({...t,vision:{...t.vision,[a]:o}})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1 bg-gray-100 rounded p-1",children:[{key:"pastor",label:"담임목사 인사말",icon:R},{key:"vision",label:"교회비전",icon:A},{key:"history",label:"교회연혁",icon:T},{key:"worship",label:"예배시간",icon:L}].map(({key:a,label:o,icon:l})=>e.jsxs("button",{onClick:()=>r(a),className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2 rounded text-[12px] font-medium transition-colors ${u===a?"bg-white text-blue-600 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:[e.jsx(l,{className:"w-3.5 h-3.5"}),o]},a))}),u==="pastor"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["이름 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.pastorGreeting.name,onChange:a=>g("name",a.target.value),className:"compact-input",placeholder:"김상현"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"직분"}),e.jsx("input",{type:"text",value:t.pastorGreeting.position,onChange:a=>g("position",a.target.value),className:"compact-input",placeholder:"담임목사"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"사진"}),e.jsxs("div",{className:"flex items-start gap-4",children:[t.pastorGreeting.photoUrl&&e.jsx("img",{src:t.pastorGreeting.photoUrl,alt:"목사님 사진",className:"w-24 h-32 object-cover rounded border border-gray-200"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("label",{className:"flex items-center justify-center gap-2 px-4 py-3 border-2 border-dashed border-gray-300 rounded hover:border-blue-600 cursor-pointer transition-colors",children:[e.jsx(C,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-[13px] text-gray-600",children:"사진 업로드"}),e.jsx("input",{type:"file",accept:"image/*",onChange:h,className:"hidden"})]}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"또는 URL 직접 입력:"}),e.jsx("input",{type:"url",value:t.pastorGreeting.photoUrl,onChange:a=>g("photoUrl",a.target.value),className:"compact-input mt-1",placeholder:"https://..."})]})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["인사말 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:t.pastorGreeting.greeting,onChange:a=>g("greeting",a.target.value),className:"compact-input min-h-[200px] resize-y",placeholder:"담임목사의 인사말을 작성합니다. 줄바꿈을 사용하여 단락을 구분할 수 있습니다."}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"줄바꿈으로 단락 구분"})]})]}),u==="vision"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["미션 (사명) ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.vision.mission,onChange:a=>n("mission",a.target.value),className:"compact-input",placeholder:"말씀이 그대로 삶이 되는 교회"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["비전 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t.vision.visionText,onChange:a=>n("visionText",a.target.value),className:"compact-input",placeholder:"다시 살아나 살리는 선교적 신앙 공동체"})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"표어 연도"}),e.jsx("input",{type:"text",value:t.vision.yearMottoYear,onChange:a=>n("yearMottoYear",a.target.value),className:"compact-input",placeholder:"2026"})]}),e.jsxs("div",{className:"col-span-3",children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"연간 표어"}),e.jsx("input",{type:"text",value:t.vision.yearMotto,onChange:a=>n("yearMotto",a.target.value),className:"compact-input",placeholder:"일어나 빛을 발하라(사60:1)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"비전 선언문"}),e.jsx("textarea",{value:t.vision.declaration,onChange:a=>n("declaration",a.target.value),className:"compact-input min-h-[120px] resize-y",placeholder:"교회의 비전 선언문을 작성합니다."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-[12px] font-medium text-gray-700",children:"공동체 소개"}),e.jsxs("button",{onClick:()=>n("communities",[...t.vision.communities,{title:"",description:""}]),className:"flex items-center gap-1 text-[11px] text-blue-600 hover:text-blue-700",children:[e.jsx(w,{className:"w-3 h-3"})," 추가"]})]}),e.jsxs("div",{className:"space-y-2",children:[t.vision.communities.map((a,o)=>e.jsxs("div",{className:"flex gap-2 items-start p-3 bg-gray-50 rounded border border-gray-200",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("input",{type:"text",value:a.title,onChange:l=>{const s=[...t.vision.communities];s[o]={...s[o],title:l.target.value},n("communities",s)},className:"compact-input",placeholder:"공동체 이름 (예: 예배 공동체)"}),e.jsx("textarea",{value:a.description,onChange:l=>{const s=[...t.vision.communities];s[o]={...s[o],description:l.target.value},n("communities",s)}
1,className:"compact-input min-h-[60px] resize-y",placeholder:"설명"})]}),e.jsx("button",{onClick:()=>{const l=t.vision.communities.filter((s,i)=>i!==o);n("communities",l)},className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:e.jsx(k,{className:"w-3.5 h-3.5"})})]},o)),t.vision.communities.length===0&&e.jsx("p",{className:"text-[11px] text-gray-400 text-center py-4",children:"공동체 소개를 추가해주세요"})]})]})]}),u==="history"&&e.jsx($,{history:t.history,onChange:a=>c({...t,history:a})}),u==="worship"&&e.jsx(V,{schedule:t.worshipSchedule,onChange:a=>c({...t,worshipSchedule:a})}),e.jsx("div",{className:"pt-4 border-t border-gray-200",children:e.jsxs("button",{onClick:p,disabled:v,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium disabled:opacity-50",children:[e.jsx(D,{className:"w-4 h-4"}),v?"저장 중...":"교회소개 저장"]})})]})}function $({history:t,onChange:c}){const[h,p]=f.useState(null);function v(){c([...t,{decade:"",description:"",events:[]}]),p(t.length)}function u(l){confirm("이 연대를 삭제하시겠습니까?")&&(c(t.filter((s,i)=>i!==l)),h===l&&p(null))}function r(l,s,i){const d=[...t];d[l]={...d[l],[s]:i},c(d)}function g(l){const s=[...t];s[l]={...s[l],events:[...s[l].events,{date:"",content:""}]},c(s)}function n(l,s,i,d){const b=[...t],m=[...b[l].events];m[s]={...m[s],[i]:d},b[l]={...b[l],events:m},c(b)}function a(l,s){const i=[...t];i[l]={...i[l],events:i[l].events.filter((d,b)=>b!==s)},c(i)}function o(l,s){const i=s==="up"?l-1:l+1;if(i<0||i>=t.length)return;const d=[...t];[d[l],d[i]]=[d[i],d[l]],c(d),p(i)}return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[11px] text-gray-500",children:"연대별 교회 역사를 관리합니다. 새 사건을 추가하면 홈페이지에 자동 반영됩니다."}),e.jsxs("button",{onClick:v,className:"flex items-center gap-1 px-3 py-1.5 text-[12px] text-white bg-blue-600 rounded hover:bg-blue-700 transition-colors",children:[e.jsx(w,{className:"w-3 h-3"})," 연대 추가"]})]}),t.length===0&&e.jsx("div",{className:"text-center py-8 text-gray-400 text-[13px]",children:'연혁이 없습니다. "연대 추가" 버튼을 눌러 시작하세요.'}),t.map((l,s)=>e.jsxs("div",{className:"border border-gray-200 rounded overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>p(h===s?null:s),children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:i=>{i.stopPropagation(),o(s,"up")},disabled:s===0,className:"p-0.5 text-gray-400 hover:text-gray-600 disabled:opacity-30",children:e.jsx(P,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:i=>{i.stopPropagation(),o(s,"down")},disabled:s===t.length-1,className:"p-0.5 text-gray-400 hover:text-gray-600 disabled:opacity-30",children:e.jsx(E,{className:"w-3.5 h-3.5"})})]}),e.jsx(T,{className:"w-4 h-4 text-blue-600"}),e.jsxs("span",{className:"text-[13px] font-bold text-gray-900 flex-1",children:[l.decade||"(연대 미입력)",l.description&&e.jsxs("span",{className:"font-normal text-gray-500 ml-2",children:["- ",l.description]})]}),e.jsxs("span",{className:"text-[11px] text-gray-400",children:[l.events.length,"개 사건"]}),e.jsx("button",{onClick:i=>{i.stopPropagation(),u(s)},className:"p-1 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:e.jsx(k,{className:"w-3.5 h-3.5"})}),h===s?e.jsx(P,{className:"w-4 h-4 text-gray-400"}):e.jsx(E,{className:"w-4 h-4 text-gray-400"})]}),h===s&&e.jsxs("div",{className:"p-4 space-y-3 border-t border-gray-200",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"연대명"}),e.jsx("input",{type:"text",value:l.decade,onChange:i=>r(s,"decade",i.target.value),className:"compact-input",placeholder:"1950년대"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"시대 설명"}),e.jsx("input",{type:"text",value:l.description,onChange:i=>r(s,"description",i.target.value),className:"compact-input",placeholder:"교회 설립과 ì´
1ˆê¸° 발전"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-[11px] font-medium text-gray-600",children:"사건 목록"}),e.jsxs("button",{onClick:()=>g(s),className:"flex items-center gap-1 text-[11px] text-blue-600 hover:text-blue-700",children:[e.jsx(w,{className:"w-3 h-3"})," 사건 추가"]})]}),e.jsxs("div",{className:"space-y-1.5",children:[l.events.map((i,d)=>e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{type:"text",value:i.date,onChange:b=>n(s,d,"date",b.target.value),className:"compact-input w-[140px] flex-shrink-0",placeholder:"1953. 09. 23"}),e.jsx("input",{type:"text",value:i.content,onChange:b=>n(s,d,"content",b.target.value),className:"compact-input flex-1",placeholder:"사건 내용"}),e.jsx("button",{onClick:()=>a(s,d),className:"p-1 text-red-400 hover:text-red-600 hover:bg-red-50 rounded flex-shrink-0",children:e.jsx(k,{className:"w-3 h-3"})})]},d)),l.events.length===0&&e.jsx("p",{className:"text-[11px] text-gray-400 text-center py-3",children:"사건을 추가해주세요"})]})]})]})]},s))]})}function V({schedule:t,onChange:c}){function h(){c([...t,{category:"",services:[{name:"",time:"",location:""}]}])}function p(n){confirm("이 카테고리를 삭제하시겠습니까?")&&c(t.filter((a,o)=>o!==n))}function v(n,a){const o=[...t];o[n]={...o[n],category:a},c(o)}function u(n){const a=[...t];a[n]={...a[n],services:[...a[n].services,{name:"",time:"",location:""}]},c(a)}function r(n,a,o,l){const s=[...t],i=[...s[n].services];i[a]={...i[a],[o]:l},s[n]={...s[n],services:i},c(s)}function g(n,a){const o=[...t];o[n]={...o[n],services:o[n].services.filter((l,s)=>s!==a)},c(o)}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[11px] text-gray-500",children:"카테고리별 예배 시간을 관리합니다."}),e.jsxs("button",{onClick:h,className:"flex items-center gap-1 px-3 py-1.5 text-[12px] text-white bg-blue-600 rounded hover:bg-blue-700 transition-colors",children:[e.jsx(w,{className:"w-3 h-3"})," 카테고리 추가"]})]}),t.map((n,a)=>e.jsxs("div",{className:"border border-gray-200 rounded p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4 text-blue-600"}),e.jsx("input",{type:"text",value:n.category,onChange:o=>v(a,o.target.value),className:"compact-input flex-1 font-bold",placeholder:"카테고리명 (예: 주일예배)"}),e.jsx("button",{onClick:()=>p(a),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:e.jsx(k,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex gap-2 text-[10px] font-medium text-gray-400 uppercase px-1",children:[e.jsx("span",{className:"flex-1",children:"예배명"}),e.jsx("span",{className:"w-[120px]",children:"시간"}),e.jsx("span",{className:"w-[120px]",children:"장소"}),e.jsx("span",{className:"w-[28px]"})]}),n.services.map((o,l)=>e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{type:"text",value:o.name,onChange:s=>r(a,l,"name",s.target.value),className:"compact-input flex-1",placeholder:"1부 예배"}),e.jsx("input",{type:"text",value:o.time,onChange:s=>r(a,l,"time",s.target.value),className:"compact-input w-[120px]",placeholder:"오전 7:30"}),e.jsx("input",{type:"text",value:o.location,onChange:s=>r(a,l,"location",s.target.value),className:"compact-input w-[120px]",placeholder:"본당"}),e.jsx("button",{onClick:()=>g(a,l),className:"p-1 text-red-400 hover:text-red-600 hover:bg-red-50 rounded flex-shrink-0",children:e.jsx(k,{className:"w-3 h-3"})})]},l))]}),e.jsxs("button",{onClick:()=>u(a),className:"flex items-center gap-1 text-[11px] text-blue-600 hover:text-blue-700",children:[e.jsx(w,{className:"w-3 h-3"})," 예배 추가"]})]},a)),t.length===0&&e.jsx("div",{className:"text-center py-8 text-gray-400 text-[13px]",children:"예배 카테고리를 추가해주세요."})]})}export{ee as ChurchSettingsPage};

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.