Files
hanarang-dashboard/frontend/components/common/TaskBadge.tsx
narang-ai 52732e88b9 feat(sprint-002): projects + task ledger + activity feed
Sprint 001 non-blocking 해결:
- N6: npm audit high 패키지 업데이트 (@nestjs/config, @nestjs/cli)
- S1: CORS origin 화이트리스트 (CORS_ORIGINS env)
- S3: DATABASE_URL 미설정 시 즉시 throw
- N2: SSH_KEY_PATH 미설정 시 즉시 throw (하드코딩 fallback 제거)
- N3: API 응답에서 내부 IP 제거
- N7: SshService 에러 메시지 마스킹 (IP 노출 차단)
- N4: theme.ts 색상 SisterCard/StatusBadge에 실제 적용
- N5: Sidebar-MainContent margin 연동 (SidebarContext)
- N9: LayoutShell Client 컴포넌트로 분리

Sprint 002 본문:
- TASK-004: GiteaService (org repo 목록, PR 조회)
- TASK-004: GET /api/projects → Gitea + DB 병합
- TASK-004: GET /api/projects/:id → 상세 + open PRs
- TASK-005: GET /api/projects/:id/tasks → Sprint/Task Ledger
- TASK-005: POST /api/projects/:id/sprints → Sprint 생성
- TASK-005: PATCH /api/tasks/:id → Task 상태 업데이트 + ActivityLog
- TASK-006: GET /api/activity, /api/projects/:id/activity
- TASK-007: /projects/[id] 상세 페이지 (SprintAccordion + TaskTable + 활동탭)
- TASK-007: 메인 대시보드에 프로젝트 섹션 + 활동 피드 추가
- 테스트 11/11 pass
2026-04-04 11:34:04 +09:00

38 lines
1.4 KiB
TypeScript

'use client';
import React from 'react';
import styled from 'styled-components';
import { theme } from '@/styles/theme';
type TaskStatus = 'pending' | 'in_progress' | 'review' | 'done' | 'failed' | 'blocked' | 'escalated';
interface TaskBadgeProps {
status: TaskStatus;
}
const statusConfig: Record<TaskStatus, { label: string; color: string; bg: string }> = {
pending: { label: '대기', color: theme.colors.textSecondary, bg: 'rgba(139,148,158,0.1)' },
in_progress: { label: '진행중', color: theme.colors.working, bg: 'rgba(41,121,255,0.12)' },
review: { label: '리뷰', color: '#FF9800', bg: 'rgba(255,152,0,0.12)' },
done: { label: '완료', color: theme.colors.online, bg: 'rgba(0,230,118,0.12)' },
failed: { label: '실패', color: theme.colors.offline, bg: 'rgba(255,23,68,0.12)' },
blocked: { label: '블로킹', color: '#FF5722', bg: 'rgba(255,87,34,0.12)' },
escalated: { label: '에스컬레이션', color: '#E040FB', bg: 'rgba(224,64,251,0.12)' },
};
const Badge = styled.span<{ $color: string; $bg: string }>`
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
color: ${({ $color }) => $color};
background: ${({ $bg }) => $bg};
white-space: nowrap;
`;
export default function TaskBadge({ status }: TaskBadgeProps) {
const cfg = statusConfig[status] ?? statusConfig.pending;
return <Badge $color={cfg.color} $bg={cfg.bg}>{cfg.label}</Badge>;
}