Files
hanarang-dashboard/frontend/components/projects/TaskTable.tsx
narang-ai 230d3847ef feat(redesign-v2): 미니멀 터미널 UI 전체 리디자인
- 디자인 시스템: #151515 배경, 1px 보더 카드, CSS vars, mono 포인트
- GlobalStyle/theme.ts v2 (DESIGN-SYSTEM.md 기반)
- 공통 컴포넌트 (ui/base.tsx): LabelMeta, BracketValue, Card, TechBar, Timeline 등
- Sidebar: [대시] 브라켓 네비 + 모바일 하단 탭바 (767px)
- LayoutShell: SidebarContext 제거, 단순화
- 대시보드 (/): SYS 상태 카드 4개 + ONGOING PROJECTS + ACTIVITY FEED
- 활동 로그 (/activities): 로그 테이블 + 필터 + 검색 + 페이지네이션 (신규)
- 설정 (/settings): 4섹션 Toggle/Bracket Input 그리드
- 자매 노드 관리 (/sisters): 3열 수평 레이아웃 (INFO/GRAPH/SYNC)
- 자매 상세 (/sisters/[name]): 간소화 + 터미널 스타일
- 조직도 (/org): 터미널 카드 트리 구조 + 레벨 색상
- 프로젝트 목록 (/projects): 새 라우트
- 프로젝트 상세 (/projects/[id]): Phase Timeline + Audit Log + Checklist
- FE 14 routes build 성공
2026-04-04 13:10:57 +09:00

130 lines
3.2 KiB
TypeScript

'use client';
import React, { useState } from 'react';
import styled from 'styled-components';
import TaskBadge from '../common/TaskBadge';
import { theme } from '@/styles/theme';
interface Task {
id: number;
taskId: string;
title: string;
assignee: string;
status: string;
iteration: number;
createdAt: string;
}
const ALL_STATUSES = ['all', 'pending', 'in_progress', 'review', 'done', 'failed', 'blocked', 'escalated'];
const Wrapper = styled.div``;
const Filters = styled.div`
display: flex;
gap: 6px;
margin-bottom: 16px;
flex-wrap: wrap;
`;
const FilterBtn = styled.button<{ $active: boolean }>`
padding: 4px 10px;
border-radius: 6px;
border: 1px solid ${({ $active }) => $active ? '#58A6FF' : 'var(--border-color)'};
background: ${({ $active }) => $active ? 'rgba(88,166,255,0.12)' : 'transparent'};
color: ${({ $active }) => $active ? '#58A6FF' : 'var(--text-secondary)'};
font-size: 12px;
cursor: pointer;
transition: all 0.15s;
&:hover { border-color: #58A6FF; color: #58A6FF; }
`;
const Table = styled.table`
width: 100%;
border-collapse: collapse;
`;
const Th = styled.th`
text-align: left;
padding: 8px 12px;
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
border-bottom: 1px solid var(--border-color);
text-transform: uppercase;
letter-spacing: 0.05em;
`;
const Td = styled.td`
padding: 10px 12px;
font-size: 13px;
border-bottom: 1px solid var(--border-color);
color: var(--text-primary);
`;
const Tr = styled.tr`
&:last-child td { border-bottom: none; }
&:hover td { background: rgba(240,246,252,0.03); }
`;
const TaskIdCell = styled.code`
color: #58A6FF;
font-family: monospace;
font-size: 12px;
`;
const IterationCell = styled.span<{ $count: number }>`
color: ${({ $count }) => $count > 0 ? '#FF9800' : 'var(--text-secondary)'};
`;
const Empty = styled.div`
padding: 32px;
text-align: center;
color: var(--text-secondary);
font-size: 13px;
`;
export default function TaskTable({ tasks }: { tasks: Task[] }) {
const [filter, setFilter] = useState('all');
const filtered = filter === 'all' ? tasks : tasks.filter((t) => t.status === filter);
return (
<Wrapper>
<Filters>
{ALL_STATUSES.map((s) => (
<FilterBtn key={s} $active={filter === s} onClick={() => setFilter(s)}>
{s === 'all' ? '전체' : s}
</FilterBtn>
))}
</Filters>
{filtered.length === 0 ? (
<Empty> </Empty>
) : (
<Table>
<thead>
<tr>
<Th>ID</Th>
<Th></Th>
<Th></Th>
<Th></Th>
<Th></Th>
</tr>
</thead>
<tbody>
{filtered.map((task) => (
<Tr key={task.id}>
<Td><TaskIdCell>{task.taskId}</TaskIdCell></Td>
<Td>{task.title}</Td>
<Td>{task.assignee}</Td>
<Td><TaskBadge status={task.status as any} /></Td>
<Td><IterationCell $count={task.iteration}>{task.iteration || '-'}</IterationCell></Td>
</Tr>
))}
</tbody>
</Table>
)}
</Wrapper>
);
}