'use client'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; import { API_URL } from '@/lib/config'; const Grid = styled.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; `; const Card = styled.a` display: block; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; padding: 18px 20px; text-decoration: none; transition: transform 0.15s, border-color 0.15s; &:hover { transform: translateY(-2px); border-color: rgba(88,166,255,0.3); } `; const RepoName = styled.div` font-size: 14px; font-weight: 700; color: #58A6FF; margin-bottom: 6px; `; const RepoDesc = styled.div` font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `; const Stats = styled.div` display: flex; gap: 14px; `; const Stat = styled.span` font-size: 12px; color: var(--text-secondary); `; const PRBadge = styled.span<{ $count: number }>` font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; background: ${({ $count }) => $count > 0 ? 'rgba(88,166,255,0.12)' : 'rgba(139,148,158,0.08)'}; color: ${({ $count }) => $count > 0 ? '#58A6FF' : 'var(--text-secondary)'}; `; const NoProjects = styled.div` padding: 32px; text-align: center; color: var(--text-secondary); font-size: 13px; `; export default function ReposPage() { const [projects, setProjects] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { fetch(`${API_URL}/api/projects`) .then((r) => r.json()) .then(setProjects) .catch(() => {}) .finally(() => setLoading(false)); }, []); if (loading) return
로딩 중...
; if (!projects.length) return 등록된 프로젝트 없음; return ( {projects.map((p) => ( 📁 {p.name} {p.description && {p.description}} PR {p.openPRs} Sprint {p.sprintCount}개 진행률 {p.progress}% ))} ); }