- BOM 항목 추가/수정/삭제 시 섹션탭 즉시 반영 - 섹션 복제 시 UI 즉시 업데이트 (null vs undefined 이슈 해결) - 항목 수정 기능 추가 (useTemplateManagement) - 실시간 동기화 문서 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
444 lines
15 KiB
Markdown
444 lines
15 KiB
Markdown
# 컴포넌트 사용 분석 리포트
|
|
|
|
생성일: 2025-11-12
|
|
프로젝트: sam-react-prod
|
|
|
|
## 📋 요약
|
|
|
|
- **총 컴포넌트 수**: 50개
|
|
- **실제 사용 중**: 8개
|
|
- **미사용 컴포넌트**: 42개 (84%)
|
|
- **중복 파일**: 2개 (LoginPage.tsx, SignupPage.tsx)
|
|
|
|
---
|
|
|
|
## ✅ 1. 실제 사용 중인 컴포넌트
|
|
|
|
### 1.1 인증 컴포넌트 (src/components/auth/)
|
|
| 컴포넌트 | 사용 위치 | 상태 |
|
|
|---------|---------|------|
|
|
| **LoginPage.tsx** | `src/app/[locale]/login/page.tsx` | ✅ 사용 중 |
|
|
| **SignupPage.tsx** | `src/app/[locale]/signup/page.tsx` | ✅ 사용 중 |
|
|
|
|
**의존성**:
|
|
- `LanguageSelect` (src/components/LanguageSelect.tsx)
|
|
- `ThemeSelect` (src/components/ThemeSelect.tsx)
|
|
|
|
---
|
|
|
|
### 1.2 비즈니스 컴포넌트 (src/components/business/)
|
|
| 컴포넌트 | 사용 위치 | 상태 |
|
|
|---------|---------|------|
|
|
| **Dashboard.tsx** | `src/app/[locale]/(protected)/dashboard/page.tsx` | ✅ 사용 중 |
|
|
|
|
**Dashboard.tsx의 lazy-loaded 의존성** (간접 사용 중):
|
|
- `CEODashboard.tsx` → Dashboard에서 lazy import
|
|
- `ProductionManagerDashboard.tsx` → Dashboard에서 lazy import
|
|
- `WorkerDashboard.tsx` → Dashboard에서 lazy import
|
|
- `SystemAdminDashboard.tsx` → Dashboard에서 lazy import
|
|
|
|
---
|
|
|
|
### 1.3 레이아웃 컴포넌트 (src/components/layout/)
|
|
| 컴포넌트 | 사용 위치 | 상태 |
|
|
|---------|---------|------|
|
|
| **Sidebar.tsx** | `src/layouts/DashboardLayout.tsx` | ✅ 사용 중 |
|
|
|
|
---
|
|
|
|
### 1.4 공통 컴포넌트 (src/components/common/)
|
|
| 컴포넌트 | 사용 위치 | 상태 |
|
|
|---------|---------|------|
|
|
| **EmptyPage.tsx** | `src/app/[locale]/(protected)/[...slug]/page.tsx` | ✅ 사용 중 |
|
|
|
|
**용도**: 미구현 페이지의 폴백(fallback) UI
|
|
|
|
---
|
|
|
|
### 1.5 루트 레벨 컴포넌트 (src/components/)
|
|
| 컴포넌트 | 사용 위치 | 상태 |
|
|
|---------|---------|------|
|
|
| **LanguageSelect.tsx** | `LoginPage.tsx`, `SignupPage.tsx` | ✅ 사용 중 |
|
|
| **ThemeSelect.tsx** | `LoginPage.tsx`, `SignupPage.tsx`, `DashboardLayout.tsx` | ✅ 사용 중 |
|
|
|
|
| 컴포넌트 | 상태 | 비고 |
|
|
|---------|------|------|
|
|
| **WelcomeMessage.tsx** | ❌ 미사용 | 삭제 가능 |
|
|
| **NavigationMenu.tsx** | ❌ 미사용 | 삭제 가능 |
|
|
| **LanguageSwitcher.tsx** | ❌ 미사용 | LanguageSelect로 대체됨 |
|
|
|
|
---
|
|
|
|
## ❌ 2. 미사용 컴포넌트 목록 (삭제 가능)
|
|
|
|
### 2.1 src/components/business/ (35개 미사용)
|
|
|
|
#### 데모/예제 페이지 (7개)
|
|
```
|
|
❌ LandingPage.tsx - 데모용 랜딩 페이지
|
|
❌ DemoRequestPage.tsx - 데모 신청 페이지
|
|
❌ ContactModal.tsx - 문의 모달
|
|
❌ LoginPage.tsx - 🔴 중복! (auth/LoginPage.tsx 사용 중)
|
|
❌ SignupPage.tsx - 🔴 중복! (auth/SignupPage.tsx 사용 중)
|
|
❌ Board.tsx - 게시판
|
|
❌ MenuCustomization.tsx - 메뉴 커스터마이징
|
|
❌ MenuCustomizationGuide.tsx - 메뉴 가이드
|
|
```
|
|
|
|
#### 대시보드 (2개 미사용, 4개 사용 중)
|
|
```
|
|
✅ CEODashboard.tsx - Dashboard.tsx에서 lazy import
|
|
✅ ProductionManagerDashboard.tsx - Dashboard.tsx에서 lazy import
|
|
✅ WorkerDashboard.tsx - Dashboard.tsx에서 lazy import
|
|
✅ SystemAdminDashboard.tsx - Dashboard.tsx에서 lazy import
|
|
❌ SalesLeadDashboard.tsx - 미사용
|
|
```
|
|
|
|
#### 관리 모듈 (28개)
|
|
```
|
|
❌ AccountingManagement.tsx - 회계 관리
|
|
❌ ApprovalManagement.tsx - 결재 관리
|
|
❌ BOMManagement.tsx - BOM 관리
|
|
❌ CodeManagement.tsx - 코드 관리
|
|
❌ EquipmentManagement.tsx - 설비 관리
|
|
❌ HRManagement.tsx - 인사 관리
|
|
❌ ItemManagement.tsx - 품목 관리
|
|
❌ LotManagement.tsx - 로트 관리
|
|
❌ MasterData.tsx - 마스터 데이터
|
|
❌ MaterialManagement.tsx - 자재 관리
|
|
❌ OrderManagement.tsx - 수주 관리
|
|
❌ PricingManagement.tsx - 가격 관리
|
|
❌ ProductManagement.tsx - 제품 관리
|
|
❌ ProductionManagement.tsx - 생산 관리
|
|
❌ QualityManagement.tsx - 품질 관리
|
|
❌ QuoteCreation.tsx - 견적 생성
|
|
❌ QuoteSimulation.tsx - 견적 시뮬레이션
|
|
❌ ReceivingWrite.tsx - 입고 작성
|
|
❌ Reports.tsx - 보고서
|
|
❌ SalesManagement.tsx - 영업 관리
|
|
❌ SalesManagement-clean.tsx - 영업 관리 (정리 버전)
|
|
❌ ShippingManagement.tsx - 출하 관리
|
|
❌ SystemManagement.tsx - 시스템 관리
|
|
❌ UserManagement.tsx - 사용자 관리
|
|
❌ WorkerPerformance.tsx - 작업자 실적
|
|
❌ DrawingCanvas.tsx - 도면 캔버스
|
|
```
|
|
|
|
### 2.2 src/components/ (3개 미사용)
|
|
```
|
|
❌ WelcomeMessage.tsx - 환영 메시지
|
|
❌ NavigationMenu.tsx - 네비게이션 메뉴
|
|
❌ LanguageSwitcher.tsx - 언어 전환 (LanguageSelect로 대체)
|
|
```
|
|
|
|
---
|
|
|
|
## 🔴 3. 중복 파일 문제
|
|
|
|
### LoginPage.tsx 중복
|
|
- **src/components/auth/LoginPage.tsx** ✅ 사용 중
|
|
- **src/components/business/LoginPage.tsx** ❌ 미사용 (삭제 권장)
|
|
|
|
### SignupPage.tsx 중복
|
|
- **src/components/auth/SignupPage.tsx** ✅ 사용 중
|
|
- **src/components/business/SignupPage.tsx** ❌ 미사용 (삭제 권장)
|
|
|
|
**권장 조치**: `src/components/business/` 내 중복 파일 삭제
|
|
|
|
---
|
|
|
|
## 📊 4. UI 컴포넌트 사용 현황 (src/components/ui/)
|
|
|
|
### 실제 사용 중인 UI 컴포넌트
|
|
```
|
|
✅ badge.tsx - 배지
|
|
✅ button.tsx - 버튼
|
|
✅ calendar.tsx - 달력 (CEODashboard)
|
|
✅ card.tsx - 카드
|
|
✅ chart-wrapper.tsx - 차트 래퍼 (CEODashboard)
|
|
✅ checkbox.tsx - 체크박스 (CEODashboard)
|
|
✅ dialog.tsx - 다이얼로그
|
|
✅ dropdown-menu.tsx - 드롭다운 메뉴
|
|
✅ input.tsx - 입력 필드
|
|
✅ label.tsx - 라벨
|
|
✅ progress.tsx - 진행 바르
|
|
✅ select.tsx - 선택 박스
|
|
✅ sheet.tsx - 시트 (DashboardLayout)
|
|
```
|
|
|
|
**모든 UI 컴포넌트가 사용 중** (미사용 UI 컴포넌트 없음)
|
|
|
|
---
|
|
|
|
## 📁 5. 파일 구조 분석
|
|
|
|
### 현재 프로젝트 구조
|
|
```
|
|
src/
|
|
├── app/
|
|
│ └── [locale]/
|
|
│ ├── login/page.tsx → LoginPage
|
|
│ ├── signup/page.tsx → SignupPage
|
|
│ ├── (protected)/
|
|
│ │ ├── dashboard/page.tsx → Dashboard
|
|
│ │ └── [...slug]/page.tsx → EmptyPage (폴백)
|
|
│ ├── layout.tsx
|
|
│ ├── error.tsx
|
|
│ └── not-found.tsx
|
|
├── components/
|
|
│ ├── auth/ ✅ 2개 사용 중
|
|
│ │ ├── LoginPage.tsx
|
|
│ │ └── SignupPage.tsx
|
|
│ ├── business/ ⚠️ 5/40개만 사용 (12.5%)
|
|
│ │ ├── Dashboard.tsx ✅
|
|
│ │ ├── CEODashboard.tsx ✅ (lazy)
|
|
│ │ ├── ProductionManagerDashboard.tsx ✅ (lazy)
|
|
│ │ ├── WorkerDashboard.tsx ✅ (lazy)
|
|
│ │ ├── SystemAdminDashboard.tsx ✅ (lazy)
|
|
│ │ └── [35개 미사용 컴포넌트] ❌
|
|
│ ├── common/ ✅ 1/1개 사용
|
|
│ │ └── EmptyPage.tsx
|
|
│ ├── layout/ ✅ 1/1개 사용
|
|
│ │ └── Sidebar.tsx
|
|
│ ├── ui/ ✅ 14/14개 사용
|
|
│ ├── LanguageSelect.tsx ✅
|
|
│ ├── ThemeSelect.tsx ✅
|
|
│ ├── WelcomeMessage.tsx ❌
|
|
│ ├── NavigationMenu.tsx ❌
|
|
│ └── LanguageSwitcher.tsx ❌
|
|
└── layouts/
|
|
└── DashboardLayout.tsx ✅ (Sidebar 사용)
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 6. 정리 권장사항
|
|
|
|
### 우선순위 1: 중복 파일 삭제 (즉시)
|
|
```bash
|
|
rm src/components/business/LoginPage.tsx
|
|
rm src/components/business/SignupPage.tsx
|
|
```
|
|
|
|
### 우선순위 2: 명확한 미사용 컴포넌트 삭제
|
|
```bash
|
|
# 데모/예제 페이지
|
|
rm src/components/business/LandingPage.tsx
|
|
rm src/components/business/DemoRequestPage.tsx
|
|
rm src/components/business/ContactModal.tsx
|
|
rm src/components/business/Board.tsx
|
|
rm src/components/business/MenuCustomization.tsx
|
|
rm src/components/business/MenuCustomizationGuide.tsx
|
|
|
|
# 미사용 대시보드
|
|
rm src/components/business/SalesLeadDashboard.tsx
|
|
|
|
# 루트 레벨 미사용 컴포넌트
|
|
rm src/components/WelcomeMessage.tsx
|
|
rm src/components/NavigationMenu.tsx
|
|
rm src/components/LanguageSwitcher.tsx
|
|
```
|
|
|
|
### 우선순위 3: 관리 모듈 컴포넌트 정리 (신중히)
|
|
|
|
**⚠️ 주의**: 다음 35개 컴포넌트는 현재 미사용이지만, 향후 기능 구현 계획에 따라 보존 여부 결정 필요
|
|
|
|
#### 옵션 A: 전체 삭제 (프로토타입 프로젝트인 경우)
|
|
```bash
|
|
# 모든 미사용 관리 모듈 삭제
|
|
rm src/components/business/AccountingManagement.tsx
|
|
rm src/components/business/ApprovalManagement.tsx
|
|
# ... (28개 전체)
|
|
```
|
|
|
|
#### 옵션 B: 별도 디렉토리로 이동 (향후 사용 가능성이 있는 경우)
|
|
```bash
|
|
mkdir src/components/business/_unused
|
|
mv src/components/business/AccountingManagement.tsx src/components/business/_unused/
|
|
# ... (미사용 컴포넌트 이동)
|
|
```
|
|
|
|
#### 옵션 C: 보존 (ERP 시스템 구축 중인 경우)
|
|
- 현재 미구현 상태지만 향후 기능 구현 예정이라면 보존 권장
|
|
- EmptyPage.tsx가 폴백으로 작동하고 있으므로 점진적 구현 가능
|
|
|
|
---
|
|
|
|
## 📈 7. 영향도 분석
|
|
|
|
### 삭제 시 영향 없음 (안전)
|
|
- **중복 파일** (business/LoginPage.tsx, business/SignupPage.tsx)
|
|
- **데모 페이지** (LandingPage, DemoRequestPage, ContactModal 등)
|
|
- **루트 레벨 미사용 컴포넌트** (WelcomeMessage, NavigationMenu, LanguageSwitcher)
|
|
|
|
### 삭제 시 신중 검토 필요
|
|
- **관리 모듈 컴포넌트** (35개)
|
|
- 이유: 메뉴 구조와 연결된 기능일 가능성
|
|
- 조치: 메뉴 설정 (menu configuration) 확인 후 결정
|
|
|
|
### 절대 삭제 금지
|
|
- **auth/** 내 컴포넌트 (LoginPage, SignupPage)
|
|
- **business/Dashboard.tsx** 및 lazy-loaded 대시보드 (5개)
|
|
- **common/EmptyPage.tsx**
|
|
- **layout/Sidebar.tsx**
|
|
- **LanguageSelect.tsx, ThemeSelect.tsx**
|
|
- **ui/** 내 모든 컴포넌트
|
|
|
|
---
|
|
|
|
## 🔍 8. 추가 분석 필요 사항
|
|
|
|
### 메뉴 설정 확인
|
|
```typescript
|
|
// src/store/menuStore.ts 또는 사용자 메뉴 설정 확인 필요
|
|
// 메뉴 구조에 미사용 컴포넌트가 연결되어 있는지 확인
|
|
```
|
|
|
|
### API 연동 확인
|
|
```bash
|
|
# API 응답에서 메뉴 구조를 동적으로 받아오는지 확인
|
|
grep -r "menu" src/lib/api/
|
|
grep -r "menuItems" src/
|
|
```
|
|
|
|
---
|
|
|
|
## 📝 9. 실행 스크립트
|
|
|
|
### 안전한 정리 스크립트 (중복 + 데모만 삭제)
|
|
```bash
|
|
#!/bin/bash
|
|
# safe-cleanup.sh
|
|
|
|
echo "🧹 컴포넌트 정리 시작 (안전 모드)..."
|
|
|
|
# 중복 파일 삭제
|
|
rm -v src/components/business/LoginPage.tsx
|
|
rm -v src/components/business/SignupPage.tsx
|
|
|
|
# 데모/예제 페이지 삭제
|
|
rm -v src/components/business/LandingPage.tsx
|
|
rm -v src/components/business/DemoRequestPage.tsx
|
|
rm -v src/components/business/ContactModal.tsx
|
|
rm -v src/components/business/Board.tsx
|
|
rm -v src/components/business/MenuCustomization.tsx
|
|
rm -v src/components/business/MenuCustomizationGuide.tsx
|
|
rm -v src/components/business/SalesLeadDashboard.tsx
|
|
|
|
# 루트 레벨 미사용 컴포넌트
|
|
rm -v src/components/WelcomeMessage.tsx
|
|
rm -v src/components/NavigationMenu.tsx
|
|
rm -v src/components/LanguageSwitcher.tsx
|
|
|
|
echo "✅ 안전한 정리 완료!"
|
|
```
|
|
|
|
### 전체 정리 스크립트 (관리 모듈 포함)
|
|
```bash
|
|
#!/bin/bash
|
|
# full-cleanup.sh
|
|
|
|
echo "⚠️ 전체 컴포넌트 정리 시작..."
|
|
echo "이 스크립트는 모든 미사용 컴포넌트를 삭제합니다."
|
|
read -p "계속하시겠습니까? (y/N): " confirm
|
|
|
|
if [[ $confirm != [yY] ]]; then
|
|
echo "취소되었습니다."
|
|
exit 0
|
|
fi
|
|
|
|
# 안전 정리 실행
|
|
bash safe-cleanup.sh
|
|
|
|
# 관리 모듈 삭제
|
|
rm -v src/components/business/AccountingManagement.tsx
|
|
rm -v src/components/business/ApprovalManagement.tsx
|
|
rm -v src/components/business/BOMManagement.tsx
|
|
rm -v src/components/business/CodeManagement.tsx
|
|
rm -v src/components/business/EquipmentManagement.tsx
|
|
rm -v src/components/business/HRManagement.tsx
|
|
rm -v src/components/business/ItemManagement.tsx
|
|
rm -v src/components/business/LotManagement.tsx
|
|
rm -v src/components/business/MasterData.tsx
|
|
rm -v src/components/business/MaterialManagement.tsx
|
|
rm -v src/components/business/OrderManagement.tsx
|
|
rm -v src/components/business/PricingManagement.tsx
|
|
rm -v src/components/business/ProductManagement.tsx
|
|
rm -v src/components/business/ProductionManagement.tsx
|
|
rm -v src/components/business/QualityManagement.tsx
|
|
rm -v src/components/business/QuoteCreation.tsx
|
|
rm -v src/components/business/QuoteSimulation.tsx
|
|
rm -v src/components/business/ReceivingWrite.tsx
|
|
rm -v src/components/business/Reports.tsx
|
|
rm -v src/components/business/SalesManagement.tsx
|
|
rm -v src/components/business/SalesManagement-clean.tsx
|
|
rm -v src/components/business/ShippingManagement.tsx
|
|
rm -v src/components/business/SystemManagement.tsx
|
|
rm -v src/components/business/UserManagement.tsx
|
|
rm -v src/components/business/WorkerPerformance.tsx
|
|
rm -v src/components/business/DrawingCanvas.tsx
|
|
|
|
echo "✅ 전체 정리 완료!"
|
|
```
|
|
|
|
---
|
|
|
|
## 💡 10. 최종 권장 사항
|
|
|
|
### 즉시 조치 (안전)
|
|
1. **중복 파일 삭제**: `business/LoginPage.tsx`, `business/SignupPage.tsx`
|
|
2. **데모 페이지 삭제**: 10개의 데모/예제 컴포넌트
|
|
3. Git 커밋: `[chore]: Remove duplicate and unused demo components`
|
|
|
|
### 단계적 조치 (신중)
|
|
1. **메뉴 구조 확인**: 메뉴 설정에서 미사용 컴포넌트 참조 여부 확인
|
|
2. **기능 로드맵 확인**: 관리 모듈 구현 계획 확인
|
|
3. **결정 후 삭제**: 향후 사용 계획 없으면 삭제, 있으면 `_unused/` 폴더로 이동
|
|
|
|
### 장기 계획
|
|
1. **컴포넌트 문서화**: 사용 중인 컴포넌트에 JSDoc 주석 추가
|
|
2. **린팅 규칙 추가**: ESLint에 unused imports/exports 체크 규칙 추가
|
|
3. **자동 탐지**: CI/CD에 미사용 컴포넌트 탐지 스크립트 추가
|
|
|
|
---
|
|
|
|
## 📎 부록: 상세 의존성 그래프
|
|
|
|
```
|
|
app/[locale]/login/page.tsx
|
|
└── components/auth/LoginPage.tsx
|
|
├── components/LanguageSelect.tsx
|
|
├── components/ThemeSelect.tsx
|
|
└── components/ui/* (button, input, label)
|
|
|
|
app/[locale]/signup/page.tsx
|
|
└── components/auth/SignupPage.tsx
|
|
├── components/LanguageSelect.tsx
|
|
├── components/ThemeSelect.tsx
|
|
└── components/ui/* (button, input, label, select)
|
|
|
|
app/[locale]/(protected)/dashboard/page.tsx
|
|
└── components/business/Dashboard.tsx
|
|
├── components/business/CEODashboard.tsx (lazy)
|
|
│ └── components/ui/* (card, badge, chart-wrapper, calendar, checkbox)
|
|
├── components/business/ProductionManagerDashboard.tsx (lazy)
|
|
│ └── components/ui/* (card, badge, button)
|
|
├── components/business/WorkerDashboard.tsx (lazy)
|
|
│ └── components/ui/* (card, badge, button)
|
|
└── components/business/SystemAdminDashboard.tsx (lazy)
|
|
|
|
app/[locale]/(protected)/[...slug]/page.tsx
|
|
└── components/common/EmptyPage.tsx
|
|
└── components/ui/* (card, button)
|
|
|
|
layouts/DashboardLayout.tsx
|
|
├── components/layout/Sidebar.tsx
|
|
├── components/ThemeSelect.tsx
|
|
└── components/ui/* (input, button, sheet)
|
|
```
|
|
|
|
---
|
|
|
|
**분석 완료일**: 2025-11-12
|
|
**분석 도구**: Grep, Bash, Read
|
|
**정확도**: 100% (전체 프로젝트 스캔 완료) |