'use client'; import React from 'react'; import styled from 'styled-components'; import Link from 'next/link'; import StatusBadge from '../common/StatusBadge'; import { theme } from '@/styles/theme'; type Status = 'online' | 'offline' | 'working' | 'unknown'; interface SisterCardProps { name: string; role: string; status: Status; lastSeen: string | null; currentTask: string | null; } const statusBorderColors: Record = { online: '#00FF00', offline: '#FF1744', working: '#2979FF', unknown: 'var(--text-secondary)', }; const sisterEmojis: Record = { harang: '🦊', narang: '🦊', darang: '🐱', erang: '🐺', }; const sisterDisplayNames: Record = { harang: 'ν•˜λž‘μ΄', narang: 'λ‚˜λž‘μ΄', darang: 'λ‹€λž‘μ΄', erang: 'μ΄λž‘μ΄', }; const Card = styled(Link)<{ $status: Status }>` background: rgba(22, 27, 34, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(240, 246, 252, 0.1); border-left: 3px solid ${({ $status }) => statusBorderColors[$status]}; border-radius: 12px; padding: 20px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: default; flex: 1; min-width: 0; &:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); } `; const CardHeader = styled.div` display: flex; align-items: center; gap: 10px; margin-bottom: 12px; `; const Emoji = styled.span` font-size: 24px; line-height: 1; `; const NameBlock = styled.div` display: flex; flex-direction: column; gap: 2px; `; const Name = styled.span` font-size: 16px; font-weight: 600; color: #E6EDF3; `; const Role = styled.span` font-size: 12px; color: #8B949E; `; const StatusRow = styled.div` margin-bottom: 10px; `; const MetaRow = styled.div` font-size: 12px; color: #8B949E; margin-top: 6px; `; const CurrentTask = styled.div` font-size: 12px; color: #58A6FF; margin-top: 8px; padding: 6px 10px; background: rgba(88, 166, 255, 0.08); border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; `; const IpBadge = styled.span` font-size: 11px; color: rgba(139, 148, 158, 0.6); font-family: monospace; `; function formatLastSeen(lastSeen: string | null): string { if (!lastSeen) return '기둝 μ—†μŒ'; const date = new Date(lastSeen); const diff = Date.now() - date.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)}일 μ „`; } export default function SisterCard({ name, role, status, lastSeen, currentTask, }: SisterCardProps) { return ( {sisterEmojis[name] ?? 'πŸ€–'} {sisterDisplayNames[name] ?? name} {role} λ§ˆμ§€λ§‰ ν™œλ™: {formatLastSeen(lastSeen)} {currentTask && πŸ“Œ {currentTask}} ); }