Files
hanarang-dashboard/frontend/components/dashboard/ActivityFeed.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

116 lines
2.4 KiB
TypeScript

'use client';
import React from 'react';
import styled from 'styled-components';
import { theme } from '@/styles/theme';
interface ActivityItem {
id: number;
action: string;
detail: string | null;
createdAt: string;
sister?: { name: string } | null;
project?: { name: string } | null;
}
const actionEmojis: Record<string, string> = {
sprint_created: '📁',
task_updated: '✏️',
deploy_complete: '🚀',
ssh_check: '🔍',
pr_opened: '📋',
pr_merged: '✅',
};
function formatTime(iso: string): string {
const d = new Date(iso);
const diff = Date.now() - d.getTime();
const min = Math.floor(diff / 60000);
if (min < 1) return '방금';
if (min < 60) return `${min}분 전`;
const hr = Math.floor(min / 60);
if (hr < 24) return `${hr}시간 전`;
return `${Math.floor(hr / 24)}일 전`;
}
const List = styled.ul`
list-style: none;
display: flex;
flex-direction: column;
gap: 0;
`;
const Item = styled.li`
display: flex;
align-items: flex-start;
gap: 10px;
padding: 10px 0;
border-bottom: 1px solid var(--border-color);
&:last-child {
border-bottom: none;
}
`;
const Emoji = styled.span`
font-size: 15px;
margin-top: 1px;
flex-shrink: 0;
`;
const Body = styled.div`
flex: 1;
min-width: 0;
`;
const Action = styled.div`
font-size: 13px;
color: var(--text-primary);
margin-bottom: 2px;
`;
const Detail = styled.div`
font-size: 12px;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
`;
const Time = styled.span`
font-size: 11px;
color: var(--text-secondary);
flex-shrink: 0;
margin-top: 2px;
`;
const Empty = styled.div`
padding: 24px;
text-align: center;
color: var(--text-secondary);
font-size: 13px;
`;
export default function ActivityFeed({ items }: { items: ActivityItem[] }) {
if (!items.length) return <Empty> </Empty>;
return (
<List>
{items.map((item) => (
<Item key={item.id}>
<Emoji>{actionEmojis[item.action] ?? '📝'}</Emoji>
<Body>
<Action>
{item.sister && <strong>{item.sister.name}</strong>}
{item.sister && ' · '}
{item.action.replace(/_/g, ' ')}
</Action>
{item.detail && <Detail>{item.detail}</Detail>}
</Body>
<Time>{formatTime(item.createdAt)}</Time>
</Item>
))}
</List>
);
}