// frontend/components/approvals/ApprovalCard.tsx — approve.jsx 이식 "use client"; import { Icon } from "@/components/Icon"; import type { IconName } from "@/components/icons/paths"; import type { ApprovalOut } from "@/lib/types"; type Props = { saved: string; pending: ApprovalOut[]; done: ApprovalOut[]; autoCountNight?: number; log?: { time: string; text: string }[]; showLog?: boolean; onApprove: (id: string) => void; onUndo: (id: string) => void; onApproveAll: () => void; }; export function ApprovalCard({ saved, pending, done, autoCountNight, log, showLog, onApprove, onUndo, onApproveAll, }: Props) { return (

아리 결재함

확인만 하면 끝 · 오늘 {saved} 아껴드렸어요
{pending.length > 0 ? ( 대기 {pending.length}건 ) : ( 모두 처리됨 )}
{/* 승인 대기 */} {pending.length === 0 ? (
결재할 게 없어요 — 아리가 알아서 하고 있어요. 아래에서 언제든 되돌릴 수 있어요.
) : (
{pending.map((it) => (
{it.title}
{it.detail}
))} {pending.length >= 2 && ( )}
)} {/* 자동 처리됨 (되돌리기) */} {done.length > 0 && (
처리됨 — 탭 한 번으로 되돌릴 수 있어요
{done.map((it) => (
{it.title} {it.time}
))}
)} {/* 활동 로그(대시보드 위젯에서만 showLog=true) */} {showLog && log && (
밤사이 조용히 한 일 {autoCountNight}건
{log.map((l, i) => (
{l.time} {l.text}
))}
)}
); }