feat(inbox): ContinuityBadge with recovery-friendly copy
Task 23 of the slice plan. Reads continuity from the zustand store and renders one of three states: '이번 주 한 줄이면 시작입니다' (0 notes), '이번 주 N/7' (in-progress), or '이번 주 7/7 ✓ · 연속 K주 완성' (target hit, with K only when > 0). No '실패'/'끊김' wording. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,2 +1,25 @@
|
||||
import React from 'react';
|
||||
export function ContinuityBadge() { return null; }
|
||||
import { useInbox } from '../store.js';
|
||||
|
||||
export function ContinuityBadge(): React.ReactElement | null {
|
||||
const c = useInbox((s) => s.continuity);
|
||||
if (!c.weekStart) return null;
|
||||
if (c.weekCount === 0) {
|
||||
return <div style={{ fontSize: 13, color: '#666' }}>이번 주 한 줄이면 시작입니다</div>;
|
||||
}
|
||||
if (c.weekCount < c.weekTarget) {
|
||||
return (
|
||||
<div style={{ fontSize: 13, color: '#444' }}>
|
||||
이번 주 <b>{c.weekCount}/{c.weekTarget}</b>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div style={{ fontSize: 13, color: '#236b1a' }}>
|
||||
이번 주 <b>{c.weekCount}/{c.weekTarget}</b> ✓
|
||||
{c.consecutiveCompleteWeeks > 0 && (
|
||||
<span style={{ color: '#888' }}> · 연속 {c.consecutiveCompleteWeeks}주 완성</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user