- CEO 대시보드 전 섹션 공통 컴포넌트 기반 리팩토링 (SectionCard, StatItem 등) - CalendarSection 일정 CRUD 기능 확장 - validation.ts → validation/ 모듈 분리 (item-schemas, form-schemas, common, utils) - CLAUDE.md Git Workflow 섹션 추가 (develop/main 플로우 정의) - Jenkinsfile CI/CD 파이프라인 정비 (Slack 알림 추가) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
'use client';
|
|
|
|
import { useRouter } from 'next/navigation';
|
|
import { LayoutGrid } from 'lucide-react';
|
|
import { IssueCardItem, CollapsibleDashboardCard } from '../components';
|
|
import type { TodayIssueItem, TodayIssueSettings } from '../types';
|
|
|
|
// 라벨 → 설정키 매핑
|
|
const LABEL_TO_SETTING_KEY: Record<string, keyof TodayIssueSettings> = {
|
|
'수주': 'orders',
|
|
'채권 추심': 'debtCollection',
|
|
'안전 재고': 'safetyStock',
|
|
'세금 신고': 'taxReport',
|
|
'신규 업체 등록': 'newVendor',
|
|
'연차': 'annualLeave',
|
|
'지각': 'lateness',
|
|
'결근': 'absence',
|
|
'발주': 'purchase',
|
|
'결재 요청': 'approvalRequest',
|
|
};
|
|
|
|
interface StatusBoardSectionProps {
|
|
items: TodayIssueItem[];
|
|
itemSettings?: TodayIssueSettings;
|
|
}
|
|
|
|
export function StatusBoardSection({ items, itemSettings }: StatusBoardSectionProps) {
|
|
const router = useRouter();
|
|
|
|
const handleItemClick = (path: string) => {
|
|
router.push(path);
|
|
};
|
|
|
|
// 설정에 따라 항목 필터링
|
|
const filteredItems = itemSettings
|
|
? items.filter((item) => {
|
|
const settingKey = LABEL_TO_SETTING_KEY[item.label];
|
|
return settingKey ? itemSettings[settingKey] : true;
|
|
})
|
|
: items;
|
|
|
|
return (
|
|
<CollapsibleDashboardCard
|
|
icon={<LayoutGrid style={{ color: '#ffffff' }} className="h-5 w-5" />}
|
|
title="현황판"
|
|
subtitle="주요 현황 요약"
|
|
>
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3">
|
|
{filteredItems.map((item) => (
|
|
<IssueCardItem
|
|
key={item.id}
|
|
label={item.label}
|
|
count={item.count}
|
|
subLabel={item.subLabel}
|
|
isHighlighted={item.isHighlighted}
|
|
onClick={() => handleItemClick(item.path)}
|
|
/>
|
|
))}
|
|
</div>
|
|
</CollapsibleDashboardCard>
|
|
);
|
|
}
|