import { useState } from 'react' import type { Org } from '../api/client' import ChannelFiles from './ChannelFiles' import ChannelPosts from './ChannelPosts' import StatusBadge from './StatusBadge' import WorkMemos from './WorkMemos' // 기관관리 상세 화면. 3단계 대시보드 시안의 "기관관리" 레이아웃을 따른다. // 웹 DB에 있는 것(연번·기관명·담당자 3종·채널)만 실데이터고, // 업무단계/통계/일부 탭 내용은 아직 백엔드가 없어 시안과 같은 골격에 // "추후 연동" 자리만 잡아 둔다. const STEPS = [ '신청', '목록접수', '예비검토', '변호사 배당', '법률검토(권리확인)', 'RE:확인', '법률검토(권리확인) 완료', '법률검토(권리처리)', 'RE:처리', '법률검토(권리처리) 완료', '법률검토 최종완료', '보고서 작성', ] const TABS = ['채팅', '자료', '권리확인', '권리처리', 'RE', '타임라인', '업무메모'] const DISABLED_ACTIONS = ['진행단계 변경', '담당 변호사 변경', '자료 업로드', '최초 게시글 보기', '보고서 관리'] // Mattermost 웹 주소. 채널 화면은 팀명 + 채널 내부명으로 열린다. // 내부명 규칙은 백엔드 ChannelNaming.java가 정본이며 여기서는 열람 링크용으로만 복제한다. const MATTERMOST_BASE = 'https://hub.iten.co.kr/itn-hub/channels/' const SPECIAL_ORG_NAME = '경찰청_치안정책연구소' function mattermostChannelUrl(org: Org): string { const slug = org.orgNo.trim().toLowerCase().replace(/_/g, '-').replace(/ /g, '-') const name = org.orgName.trim() === SPECIAL_ORG_NAME ? `org-${slug}-policy-mj` : `org-${slug}-mj` return MATTERMOST_BASE + name } function Cell({ value }: { value: string | null }) { return {value ?? '-'} } interface ContactRow { role: string dept: string | null manager: string | null phone: string | null email: string | null assignedDate: string | null } function contactRows(org: Org): ContactRow[] { return [ { role: '신청기관 담당자', dept: org.deptName, manager: org.managerName ? org.managerTitle ? `${org.managerName} ${org.managerTitle}` : org.managerName : null, phone: org.managerPhone, email: org.managerEmail, assignedDate: null, }, { role: '문정원 담당자', dept: org.mjDeptName, manager: org.mjManagerName, phone: org.mjManagerPhone, email: org.mjManagerEmail, assignedDate: null, }, { role: '담당 변호사', dept: null, manager: org.lawyerName, phone: org.lawyerPhone, email: org.lawyerEmail, assignedDate: org.lawyerAssignedDate, }, ] } export default function OrgOverview({ org }: { org: Org }) { const [activeTab, setActiveTab] = useState(TABS[0]) return (
| 구분 | 부서 | 담당자 | 연락처 | 이메일 | 배정일 |
|---|---|---|---|---|---|
| {row.role} |
|
|
|
|
|
{title}
{caption} -