- 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>
66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
'use client';
|
|
|
|
import { useRouter } from 'next/navigation';
|
|
import { CreditCard, Wallet, Receipt, AlertTriangle } from 'lucide-react';
|
|
import { AmountCardItem, CheckPointItem, CollapsibleDashboardCard, type SectionColorTheme } from '../components';
|
|
import type { CardManagementData } from '../types';
|
|
|
|
// 카드별 아이콘 매핑
|
|
const CARD_ICONS = [CreditCard, Wallet, Receipt, AlertTriangle];
|
|
const CARD_THEMES: SectionColorTheme[] = ['blue', 'indigo', 'purple', 'orange'];
|
|
|
|
interface CardManagementSectionProps {
|
|
data: CardManagementData;
|
|
onCardClick?: (cardId: string) => void;
|
|
}
|
|
|
|
export function CardManagementSection({ data, onCardClick }: CardManagementSectionProps) {
|
|
const router = useRouter();
|
|
|
|
const handleClick = (cardId: string) => {
|
|
if (onCardClick) {
|
|
onCardClick(cardId);
|
|
} else {
|
|
router.push('/ko/accounting/card-management');
|
|
}
|
|
};
|
|
|
|
return (
|
|
<CollapsibleDashboardCard
|
|
icon={<CreditCard style={{ color: '#ffffff' }} className="h-5 w-5" />}
|
|
title="카드/가지급금 관리"
|
|
subtitle="카드 및 가지급금 현황"
|
|
>
|
|
{data.warningBanner && (
|
|
<div className="bg-red-500 text-white text-sm font-medium px-4 py-2 rounded-lg mb-4 flex items-center gap-2">
|
|
<AlertTriangle className="h-4 w-4" />
|
|
{data.warningBanner}
|
|
</div>
|
|
)}
|
|
|
|
<div className="grid grid-cols-1 xs:grid-cols-2 md:grid-cols-4 gap-3 xs:gap-4 mb-4">
|
|
{data.cards.map((card, idx) => (
|
|
<AmountCardItem
|
|
key={card.id}
|
|
card={card}
|
|
onClick={() => handleClick(card.id)}
|
|
icon={CARD_ICONS[idx] || CreditCard}
|
|
colorTheme={CARD_THEMES[idx] || 'blue'}
|
|
showTrend={!!card.previousLabel}
|
|
trendValue={card.previousLabel}
|
|
trendDirection="up"
|
|
/>
|
|
))}
|
|
</div>
|
|
|
|
{data.checkPoints.length > 0 && (
|
|
<div className="border-t pt-4 space-y-1">
|
|
{data.checkPoints.map((cp) => (
|
|
<CheckPointItem key={cp.id} checkpoint={cp} />
|
|
))}
|
|
</div>
|
|
)}
|
|
</CollapsibleDashboardCard>
|
|
);
|
|
}
|